summaryrefslogtreecommitdiffstats
path: root/apps/gallery
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-02-08 21:11:45 +0100
committerBart Visscher <bartv@thisnet.nl>2012-02-08 21:12:31 +0100
commit7cd1a302d36259ef8496ea59d7060c99b6d10e25 (patch)
treed5c474f04bb040d4f565064e76f1bbd272040b82 /apps/gallery
parent158360c09b2f14b676daf3091c5743fd2a50748a (diff)
downloadnextcloud-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.php5
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();
}