diff options
author | Urban Müller | 2024-08-06 00:51:14 +0200 |
---|---|---|
committer | Urban Müller | 2024-08-06 00:51:14 +0200 |
commit | 24331e26b7308f25ed9e75401c79152e58bd9557 (patch) | |
tree | 47f19f1126d1090125cf2ec5d9c4aef64ee934bc | |
parent | 5b6b40f7ac705ffda91b6422296eb19d71f79a41 (diff) | |
download | itools-24331e26b7308f25ed9e75401c79152e58bd9557.tar.gz itools-24331e26b7308f25ed9e75401c79152e58bd9557.tar.bz2 itools-24331e26b7308f25ed9e75401c79152e58bd9557.zip |
try to reduce crawler accesses on cacheable data
-rw-r--r-- | itjs.class | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -186,7 +186,8 @@ static function far_future_headers($p = array()) if (it::is_live() && !$_REQUEST['retry']) { $keeptime = $crc == "-" ? 0 : ($crc || $p['nocrc'] ? 30*86400 : 900); # long expire if checksum present - header("Cache-Control: max-age=$keeptime, private"); # proxies should not cache since contents of same url can differ between browsers + $private = it::match('Googlebot|Bingbot|Slurp|DuckDuckBot', $_SERVER['HTTP_USER_AGENT']) ? "public" : "private"; + 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"); } } |