generated from francesco/deploy-dinamico
Aggiunta cache al caricamento delle immagini
All checks were successful
Deploy / trigger (push) Successful in 2s
All checks were successful
Deploy / trigger (push) Successful in 2s
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user