summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
-rw-r--r--modules/gallery/controllers/file_proxy.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 65c0cb50..72c4e104 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -99,6 +99,12 @@ class File_Proxy_Controller extends Controller {
throw new Kohana_404_Exception();
}
+ // Check that the content hasn't expired or it wasn't changed since cached
+ if (($last_modified = expires::get()) !== false &&
+ $item->updated < $last_modified) {
+ expires::check(2592000);
+ }
+
// Don't try to load a directory
if ($type == "albums" && $item->is_album()) {
throw new Kohana_404_Exception();
@@ -111,6 +117,8 @@ class File_Proxy_Controller extends Controller {
// We don't need to save the session for this request
Session::abort_save();
+ expires::set(2592000); // 30 days
+
// Dump out the image. If the item is a movie, then its thumbnail will be a JPG.
if ($item->is_movie() && $type != "albums") {
header("Content-type: image/jpeg");