diff options
author | Urban Müller | 2015-11-03 19:15:14 +0100 |
---|---|---|
committer | Urban Müller | 2015-11-09 14:29:18 +0100 |
commit | 61d20830c3b154e343408c3206a8d01d4756789b (patch) | |
tree | 188e82e58376cdb759f2bfa3b36abe6c60f1f63d | |
parent | 9aab17be924ec04b7b46a971d3c9f414f6eb9bf0 (diff) | |
download | itools-61d20830c3b154e343408c3206a8d01d4756789b.tar.gz itools-61d20830c3b154e343408c3206a8d01d4756789b.tar.bz2 itools-61d20830c3b154e343408c3206a8d01d4756789b.zip |
dont omit long expire if url was recently redownloaded
-rw-r--r-- | itjs.class | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -207,14 +207,14 @@ static function checksum($fnlist, $p = array()) return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, false)), 0, 10), array('ttl' => 60)); } -function crcurl($url) +function crcurl($url, $p = []) { if (it::match('^http', $url)) # remote url, must fetch to crc - $fn = it_url::get_cache(array('url' => $url, 'maxage' => 3600)); + list($fn, $short_expire) = array(it_url::get_cache(array('url' => $url, 'maxage' => 3600) + $p), false); else - $fn = ($m = it::match("^//(\w+)(/.*)", $url)) ? "/www/$m[0].search.ch" . $m[1] : $GLOBALS['ULTRAHOME'] . $url; + list($fn, $short_expire) = array(($m = it::match("^//(\w+)(/.*)", $url)) ? "/www/$m[0].search.ch" . $m[1] : $GLOBALS['ULTRAHOME'] . $url, true);; - return it::match('#', $url) ? U(trim($url, "#")) : U($url, array('c' => self::checksum(array($fn)))); + return it::match('#', $url) ? U(trim($url, "#")) : U($url, array('c' => self::checksum(array($fn), array('short_expire' => $short_expire)))); } static function far_future_headers() |