diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-04 09:10:12 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-04 09:10:12 -0800 |
commit | cbf9754922f9b5accf0542921f80b571ae36f373 (patch) | |
tree | d8557e5e6dd49d5f118cb897e77bfb2ba23986fd | |
parent | 6c5bb4362957c26e8b340c3d7bdc49d14b51ad5e (diff) |
Send an empty Pragma header and use the item-updated time in the last-modified header
-rw-r--r-- | modules/gallery/controllers/file_proxy.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 72c4e104..f0a38fbe 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -99,12 +99,6 @@ 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(); @@ -114,10 +108,15 @@ class File_Proxy_Controller extends Controller { throw new Kohana_404_Exception(); } + header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $item->updated)); + header("Pragma:"); + // Check that the content hasn't expired or it wasn't changed since cached + expires::check(2592000, $item->updated); + // We don't need to save the session for this request Session::abort_save(); - expires::set(2592000); // 30 days + expires::set(2592000, $item->updated); // 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") { |