mirror of
https://github.com/seigler/neat-charts
synced 2025-07-27 01:16:09 +00:00
add EXPIRES header even in HTTP 304 not modified
This commit is contained in:
parent
4d78085a3c
commit
b1e5fababa
1 changed files with 2 additions and 2 deletions
|
@ -31,6 +31,7 @@
|
||||||
// always send headers
|
// always send headers
|
||||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT");
|
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified_time)." GMT");
|
||||||
header("Etag: $etag");
|
header("Etag: $etag");
|
||||||
|
header("Expires: ".gmdate("D, d M Y H:i:s", $last_modified_time + CACHE_TIME)." GMT");
|
||||||
|
|
||||||
// exit if not modified
|
// exit if not modified
|
||||||
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time ||
|
if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time ||
|
||||||
|
@ -40,7 +41,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// if so, display cache file and stop processing
|
// if so, display cache file and stop processing
|
||||||
header("Expires: ".gmdate("D, d M Y H:i:s", $last_modified_time + CACHE_TIME)." GMT");
|
|
||||||
readfile($file);
|
readfile($file);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
fwrite($f, $content);
|
fwrite($f, $content);
|
||||||
fclose($f);
|
fclose($f);
|
||||||
}
|
}
|
||||||
$last_modified_time = filemtime($file);
|
$last_modified_time = time();
|
||||||
$etag = md5_file($file);
|
$etag = md5_file($file);
|
||||||
|
|
||||||
// always send headers
|
// always send headers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue