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);
|
$imageData = curl_exec($downloadImg);
|
||||||
$contentType = curl_getinfo($downloadImg, CURLINFO_CONTENT_TYPE);
|
$contentType = curl_getinfo($downloadImg, CURLINFO_CONTENT_TYPE);
|
||||||
header("Content-Type: " . $contentType);
|
header("Content-Type: " . $contentType);
|
||||||
|
|
||||||
|
$etag = md5($imageData);
|
||||||
|
header("ETag: \"$etag\"");
|
||||||
|
header("Cache-Control: public, max-age=604800");
|
||||||
|
|
||||||
echo $imageData;
|
echo $imageData;
|
||||||
} else {
|
} else {
|
||||||
header("Content-Type: image/png");
|
header("Content-Type: image/png");
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ header .container {
|
|||||||
|
|
||||||
footer .container {
|
footer .container {
|
||||||
padding: 2rem 0;
|
padding: 2rem 0;
|
||||||
|
padding-top: 4rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
|||||||
Reference in New Issue
Block a user