summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--itjs.class8
1 files changed, 4 insertions, 4 deletions
diff --git a/itjs.class b/itjs.class
index f76620f..32c504b 100644
--- a/itjs.class
+++ b/itjs.class
@@ -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()