From ceffa04b6e0acabec70cf5e6b54228f36da386eb Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 3 Jun 2020 00:38:05 +0200 Subject: [PATCH] implemented tag and last-modified for images. closes #119 --- content-controllers/image/image.controller.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content-controllers/image/image.controller.php b/content-controllers/image/image.controller.php index bec053c..0dbe3a8 100644 --- a/content-controllers/image/image.controller.php +++ b/content-controllers/image/image.controller.php @@ -192,21 +192,29 @@ class ImageController implements ContentController case 'jpeg': case 'jpg': header ("Content-type: image/jpeg"); + header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT'); + header ("ETag: $hash"); readfile($path); break; case 'png': header ("Content-type: image/png"); + header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT'); + header ("ETag: $hash"); readfile($path); break; case 'gif': header ("Content-type: image/gif"); + header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT'); + header ("ETag: $hash"); readfile($path); break; case 'webp': header ("Content-type: image/webp"); + header ("Last-Modified: ".gmdate('D, d M Y H:i:s ', filemtime($path)) . 'GMT'); + header ("ETag: $hash"); readfile($path); break; }