diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-08 21:11:45 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-08 21:12:31 +0100 |
commit | 7cd1a302d36259ef8496ea59d7060c99b6d10e25 (patch) | |
tree | d5c474f04bb040d4f565064e76f1bbd272040b82 /apps/gallery | |
parent | 158360c09b2f14b676daf3091c5743fd2a50748a (diff) | |
download | nextcloud-server-7cd1a302d36259ef8496ea59d7060c99b6d10e25.tar.gz nextcloud-server-7cd1a302d36259ef8496ea59d7060c99b6d10e25.zip |
Gallery: Add caching headers to album thumbnail sending
Diffstat (limited to 'apps/gallery')
-rw-r--r-- | apps/gallery/ajax/galleryOp.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php index 0ec447d01f6..8df692c7735 100644 --- a/apps/gallery/ajax/galleryOp.php +++ b/apps/gallery/ajax/galleryOp.php @@ -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(); } |