Add a cache-control header for the images so that the browser caches the image for a day
This commit is contained in:
parent
6f23c71773
commit
967beadeb3
@ -20,7 +20,9 @@ $params = new ResizeParams($_GET);
|
|||||||
$resizer = new Resizer($imageDb, $logger);
|
$resizer = new Resizer($imageDb, $logger);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
echo $resizer->performResize($imgPath, $params);
|
$image = $resizer->performResize($imgPath, $params);
|
||||||
|
header("Cache-Control: max-age=86400, public");
|
||||||
|
echo $image;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$logger->error($e->getMessage());
|
$logger->error($e->getMessage());
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
|
Loading…
Reference in New Issue
Block a user