]> source.dussan.org Git - nextcloud-server.git/commitdiff
Gallery: Add caching headers to album thumbnail sending
authorBart Visscher <bartv@thisnet.nl>
Wed, 8 Feb 2012 20:11:45 +0000 (21:11 +0100)
committerBart Visscher <bartv@thisnet.nl>
Wed, 8 Feb 2012 20:12:31 +0000 (21:12 +0100)
apps/gallery/ajax/galleryOp.php

index 0ec447d01f68d0745a1a4e8df63397ab57bbc4d6..8df692c77351e63e6bd000be183efbcf96968686 100644 (file)
@@ -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();
 }