Skip to content
Snippets Groups Projects
Commit 7cd1a302 authored by Bart Visscher's avatar Bart Visscher
Browse files

Gallery: Add caching headers to album thumbnail sending

parent 158360c0
Branches
No related tags found
No related merge requests found
...@@ -45,6 +45,11 @@ function handleGetThumbnails($albumname) { ...@@ -45,6 +45,11 @@ function handleGetThumbnails($albumname) {
OC_JSON::checkLoggedIn(); OC_JSON::checkLoggedIn();
$photo = new OC_Image(); $photo = new OC_Image();
$photo->loadFromFile(OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png'); $photo->loadFromFile(OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png');
$offset = 3600 * 24; // 24 hour
// calc the string in GMT not localtime and add the offset
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT");
header('Cache-Control: max-age='.$offset.', must-revalidate');
header('Pragma: public');
$photo->show(); $photo->show();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment