diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-08-24 12:44:14 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-08-24 12:44:14 +0000 |
commit | 5028d5fba9823b767d05925117d9ffc515a3d215 (patch) | |
tree | e6e88f70949203ce4ba1ebbaa8ce29346d7a36f6 | |
parent | 1d34a3e3294d8d6fafeed2e73f00a37853a03a90 (diff) | |
download | brdo-5028d5fba9823b767d05925117d9ffc515a3d215.tar.gz brdo-5028d5fba9823b767d05925117d9ffc515a3d215.tar.bz2 |
- Patch #303419 by drewish: incorrect expiration headers with private file transfers.
-rw-r--r-- | modules/image/image.module | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/image/image.module b/modules/image/image.module index 274742e44..e8d8e3c28 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -203,8 +203,15 @@ function image_file_download($filepath) { $headers = module_invoke_all('file_download', $original_path); if (!in_array(-1, $headers)) { return array( + // Send headers describing the image's size, and MIME-type... 'Content-Type' => $info['mime_type'], 'Content-Length' => $info['file_size'], + // ...and allow the file to be cached for two weeks (matching the + // value we use for the mod_expires settings in .htaccess) and + // ensure that caching proxies do not share the image with other + // users. + 'Expires' => gmdate(DATE_RFC1123, time() + 1209600), + 'Cache-Control' => 'max-age=1209600, private, must-revalidate', ); } } |