From: Aaron Schulz Date: Fri, 2 Sep 2016 22:59:52 +0000 (-0700) Subject: Use WAN cache adaptiveTTL() method in FileBackendStore X-Git-Tag: 1.31.0-rc.0~5778 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=1ba6d52141ff5a075134b3f52fff7bc95b330286;p=lhc%2Fweb%2Fwiklou.git Use WAN cache adaptiveTTL() method in FileBackendStore Change-Id: I2e8b4e85b12c8892e8640abc63ee13b4b170645d --- diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index a29119c9cf..db6575e198 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -1702,8 +1702,8 @@ abstract class FileBackendStore extends FileBackend { if ( $path === null ) { return; // invalid storage path } - $age = time() - wfTimestamp( TS_UNIX, $val['mtime'] ); - $ttl = min( 7 * 86400, max( 300, floor( .1 * $age ) ) ); + $mtime = wfTimestamp( TS_UNIX, $val['mtime'] ); + $ttl = $this->memCache->adaptiveTTL( $mtime, 7 * 86400, 300, .1 ); $key = $this->fileCacheKey( $path ); // Set the cache unless it is currently salted. $this->memCache->set( $key, $val, $ttl );