resourceloader: Set a TTL for minification cache entries
Follows-up 458e7cabbb. HHVM's APC cache doesn't have any
limitation or eviction logic. Thus entries without a TTL will
linger indefinitely.
At time of writing over 99% of APC entries were from "resourceloader:filter"
because there are far more unpopular resources than popular ones.
A fixed TTL is suboptimal as it will also cause popular resources
(e.g. startup module, or jquery) to be re-minified every day.
Beware this isn't one single minification. It's one minification,
for every JS/CSS resource, on every app server, for many different
lang/skin/config variations.
Bug: T104769
Change-Id: Ib62c320da0eeede68aad3f2294006ec7dcf1df55
This commit is contained in:
parent
1224a70009
commit
bdb4a243ea
1 changed files with 2 additions and 1 deletions
|
|
@ -224,7 +224,8 @@ class ResourceLoader implements LoggerAwareInterface {
|
||||||
if ( $options['cacheReport'] ) {
|
if ( $options['cacheReport'] ) {
|
||||||
$result .= "\n/* cache key: $key */";
|
$result .= "\n/* cache key: $key */";
|
||||||
}
|
}
|
||||||
$cache->set( $key, $result );
|
// Set a TTL since HHVM's APC doesn't have any limitation or eviction logic.
|
||||||
|
$cache->set( $key, $result, 24 * 3600 );
|
||||||
} catch ( Exception $e ) {
|
} catch ( Exception $e ) {
|
||||||
MWExceptionHandler::logException( $e );
|
MWExceptionHandler::logException( $e );
|
||||||
$this->logger->warning( 'Minification failed: {exception}', array(
|
$this->logger->warning( 'Minification failed: {exception}', array(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue