diff options
author | Urban Müller | 2014-09-26 16:50:45 +0200 |
---|---|---|
committer | Urban Müller | 2014-09-26 16:50:45 +0200 |
commit | c3e297e08ff1e1a60617e64bf3eace8db07c18f8 (patch) | |
tree | 3817f32a38a68dbe535a8b7435c166741237418d /itjs.class | |
parent | acb0851e32c9a4d3a0ae3c250e3e65fde86c9620 (diff) | |
download | itools-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.class')
-rw-r--r-- | itjs.class | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |