Gallery: Add caching headers to album thumbnail sending
This commit is contained in:
parent
158360c09b
commit
7cd1a302d3
1 changed files with 5 additions and 0 deletions
|
@ -45,6 +45,11 @@ function handleGetThumbnails($albumname) {
|
|||
OC_JSON::checkLoggedIn();
|
||||
$photo = new OC_Image();
|
||||
$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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue