From fc5999f50afe4d95af2081517d1f1e2129e2e75c Mon Sep 17 00:00:00 2001 From: Francesco Mancuso Date: Sun, 12 Apr 2026 21:16:30 +0200 Subject: [PATCH] Aggiunta cache al caricamento delle immagini --- file/api/v1/img/index.php | 5 +++++ file/style.css | 1 + 2 files changed, 6 insertions(+) diff --git a/file/api/v1/img/index.php b/file/api/v1/img/index.php index ddfeedc..9c29231 100644 --- a/file/api/v1/img/index.php +++ b/file/api/v1/img/index.php @@ -35,6 +35,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $imageData = curl_exec($downloadImg); $contentType = curl_getinfo($downloadImg, CURLINFO_CONTENT_TYPE); header("Content-Type: " . $contentType); + + $etag = md5($imageData); + header("ETag: \"$etag\""); + header("Cache-Control: public, max-age=604800"); + echo $imageData; } else { header("Content-Type: image/png"); diff --git a/file/style.css b/file/style.css index 8cbcdff..e3513a9 100644 --- a/file/style.css +++ b/file/style.css @@ -148,6 +148,7 @@ header .container { footer .container { padding: 2rem 0; + padding-top: 4rem; text-align: center; opacity: 0.8; font-size: 90%;