send Last-Modified header with the local image

This commit is contained in:
Mike Frysinger 2013-03-29 17:36:51 -04:00
parent 2472737e20
commit dd856b4845
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@
if (file_exists($filename)) { if (file_exists($filename)) {
header("Content-type: image/png"); header("Content-type: image/png");
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)). " GMT";
header("Last-Modified: $stamp", true);
echo file_get_contents($filename); echo file_get_contents($filename);
} else { } else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");