summaryrefslogtreecommitdiff
path: root/itjs.php
diff options
context:
space:
mode:
authorUrban Müller2014-09-26 16:50:45 +0200
committerUrban Müller2014-09-26 16:50:45 +0200
commitc3e297e08ff1e1a60617e64bf3eace8db07c18f8 (patch)
tree3817f32a38a68dbe535a8b7435c166741237418d /itjs.php
parentacb0851e32c9a4d3a0ae3c250e3e65fde86c9620 (diff)
downloaditools-c3e297e08ff1e1a60617e64bf3eace8db07c18f8.tar.gz
itools-c3e297e08ff1e1a60617e64bf3eace8db07c18f8.tar.bz2
itools-c3e297e08ff1e1a60617e64bf3eace8db07c18f8.zip
trigger short expire if files recently updated (may not yet be up to date on other slaves)
Diffstat (limited to 'itjs.php')
-rw-r--r--itjs.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/itjs.php b/itjs.php
index 4bcacbe..62cd474 100644
--- a/itjs.php
+++ b/itjs.php
@@ -24,7 +24,8 @@ require "itools/itools.lib";
if (EDC('slow' . it::match('\.(\w+)$', $_SERVER['PHP_SELF'])))
sleep(10);
-if (false && !$_SERVER['HTTP_CACHE_CONTROL'] && $_SERVER['HTTP_IF_NONE_MATCH'] && !it::is_devel() && !$_REQUEST['retry'])
+$crc = $_REQUEST['c'] ?: $_REQUEST['s'];
+if (false && $crc != "-" && !$_SERVER['HTTP_CACHE_CONTROL'] && $_SERVER['HTTP_IF_NONE_MATCH'] && !it::is_devel() && !$_REQUEST['retry'])
{
header("HTTP/1.0 304 Not Modified"); # client should always keep the component that fits the page it has
exit;
@@ -71,7 +72,7 @@ else if (!it::match('\.html$', $file))
if (it::is_live() && !$_REQUEST['retry'])
{
- $keeptime = /* $_REQUEST['s'] || $_REQUEST['c'] ? 86400*30 : */ 900; # long expire if checksum present DISABLED
+ $keeptime = $crc == "-" ? 0 : ($crc ? 900 : 900); # long expire if checksum present DISABLED
header("Cache-Control: max-age=$keeptime, private"); # proxies should not cache since contents of same url can differ between browsers
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $keeptime). " GMT");
}