From: Roan Kattouw Date: Thu, 6 Oct 2011 14:07:57 +0000 (+0000) Subject: Per Domas, reinstate <1e9 check that was dropped in r94199. Also document what these... X-Git-Tag: 1.31.0-rc.0~27229 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=f8024445dd29ce75d4633f0ab738de287ff4158d;p=lhc%2Fweb%2Fwiklou.git Per Domas, reinstate <1e9 check that was dropped in r94199. Also document what these checks are all about in more detail. --- diff --git a/includes/objectcache/MemcachedClient.php b/includes/objectcache/MemcachedClient.php index dd4401a894..6e17a9eff9 100644 --- a/includes/objectcache/MemcachedClient.php +++ b/includes/objectcache/MemcachedClient.php @@ -959,9 +959,12 @@ class MWMemcached { $this->stats[$cmd] = 1; } - // Memcached doesn't seem to handle very high TTL values very well, - // so clamp them at 30 days - if ( $exp > 2592000 ) { + // TTLs higher than 30 days will be detected as absolute TTLs + // (UNIX timestamps), and will result in the cache entry being + // discarded immediately because the expiry is in the past. + // Clamp expiries >30d at 30d, unless they're >=1e9 in which + // case they are likely to really be absolute (1e9 = 2011-09-09) + if ( $exp > 2592000 && $exp < 1000000000 ) { $exp = 2592000; }