summaryrefslogtreecommitdiff
path: root/lib/exe/fetch.php
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-03-15 13:02:48 +0100
committerBen Coburn <btcoburn@silicodon.net>2006-03-15 13:02:48 +0100
commitff4f5ee7a60096f8c57271eea2986f73a52da025 (patch)
tree37c349239efa4e3e4be6bf3bf3ad0dfa353e8165 /lib/exe/fetch.php
parent38f56bff745c0010f5a3d0e13c2de33373616d0e (diff)
downloadrpg-ff4f5ee7a60096f8c57271eea2986f73a52da025.tar.gz
rpg-ff4f5ee7a60096f8c57271eea2986f73a52da025.tar.bz2
fixed bug where '304 Not Modified' worked every other time because cache headers were not sent
darcs-hash:20060315120248-05dcb-5d5d4e06d0074a687185131cda2000b914346e19.gz
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r--lib/exe/fetch.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index 390e77bfc..87c47d7cb 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -82,11 +82,12 @@
function sendFile($file,$mime){
// send headers
header("Content-Type: $mime");
- http_conditionalRequest(filemtime($file));
- list($start,$len) = http_rangeRequest(filesize($file));
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Accept-Ranges: bytes');
+ //send important headers first, script stops here if '304 Not Modified' response
+ http_conditionalRequest(filemtime($file));
+ list($start,$len) = http_rangeRequest(filesize($file));
//application mime type is downloadable
if(substr($mime,0,11) == 'application'){