summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class5
1 files changed, 4 insertions, 1 deletions
diff --git a/itjs.class b/itjs.class
index c8fe29b..f73698d 100644
--- a/itjs.class
+++ b/itjs.class
@@ -191,7 +191,10 @@ static function checksum($fnlist)
$filenames = array_merge(is_array($fnlist) ? $fnlist : itjs::filenames($fnlist), array("/www/lib.search.ch/var/jquery-ui/dist/minified/jquery.ui.core.min.js", "/www/lib.search.ch/var/jquery/dist/jquery.min.js")); # jquery files included by lib/jquery.js
$key = "itjs_" . md5(join("", it::map('"$v" . @filemtime("$v")', $filenames)));
- return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, false)), 0, 10), array('ttl' => 60));
+ if (time() - max(array_map('filemtime', $filenames)) < 60)
+ return "-"; # trigger short expire, our file may not yet be up to date on other slaves
+ else
+ return it_cache::get($key) ?: it_cache::put($key, substr(md5(self::filecontents($filenames, false)), 0, 10), array('ttl' => 60));
}
function crcurl($url)