diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 22:38:34 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 22:38:34 +0100 |
commit | e137020f67f97bb04e59c04205e1815229d95fae (patch) | |
tree | a0ca734cd40c1206612578546d7e13b05e839f21 /apps/gallery | |
parent | 363fdc40b82f5e7ba0de7a11f031bc8d86af68be (diff) | |
download | nextcloud-server-e137020f67f97bb04e59c04205e1815229d95fae.tar.gz nextcloud-server-e137020f67f97bb04e59c04205e1815229d95fae.zip |
Gallery: Use OC_Respone::enableCaching for (album)thumbnails
Diffstat (limited to 'apps/gallery')
-rw-r--r-- | apps/gallery/ajax/galleryOp.php | 6 | ||||
-rw-r--r-- | apps/gallery/ajax/thumbnail.php | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php index db6c79d6cdc..9273de2599d 100644 --- a/apps/gallery/ajax/galleryOp.php +++ b/apps/gallery/ajax/galleryOp.php @@ -40,13 +40,9 @@ function handleRemove($name) { } function handleGetThumbnails($albumname) { + OC_Response::enableCaching(3600 * 24); // 24 hour $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(); } diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php index 2dfe936d9dd..184171f8fca 100644 --- a/apps/gallery/ajax/thumbnail.php +++ b/apps/gallery/ajax/thumbnail.php @@ -29,10 +29,6 @@ $img = $_GET['img']; $image = OC_Gallery_Photo::getThumbnail($img); if ($image) { - $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'); + OC_Response::enableCaching(3600 * 24); // 24 hour $image->show(); } |