Change-Id: I2e8b4e85b12c8892e8640abc63ee13b4b170645d
if ( $path === null ) {
return; // invalid storage path
}
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 );
$key = $this->fileCacheKey( $path );
// Set the cache unless it is currently salted.
$this->memCache->set( $key, $val, $ttl );