diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-30 15:52:18 -0800 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-12-30 15:52:18 -0800 |
| commit | d50b7531993fcf7dee2542255f11b20257db737d (patch) | |
| tree | ea76324fe18732954de0c3ea314ba805591ec0ad /modules/gallery/controllers | |
| parent | 2e98825c25c540dfc2555a2f36bc3b9e2f80db54 (diff) | |
| parent | 7af844606d79d1f987c6d754f5c5db64d86acc47 (diff) | |
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/gallery/controllers')
| -rw-r--r-- | modules/gallery/controllers/file_proxy.php | 8 |
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"); |
