add EXPIRES header so that browsers can use built-in caching rules

This commit is contained in:
Joshua Seigler 2016-06-26 13:25:51 -04:00
parent efac02515e
commit 4d78085a3c

View file

@ -40,6 +40,7 @@
} }
// if so, display cache file and stop processing // if so, display cache file and stop processing
header("Expires: ".gmdate("D, d M Y H:i:s", $last_modified_time + CACHE_TIME)." GMT");
readfile($file); readfile($file);
exit; exit;
} }
@ -57,6 +58,7 @@
// always send headers // always send headers
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT");
header("Etag: $etag"); header("Etag: $etag");
header("Expires: ".gmdate("D, d M Y H:i:s", $last_modified_time + CACHE_TIME)." GMT");
return $content; return $content;
} }