From 001f72e9ed0b8350d4e40098ee1544975776ebb6 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 10 Jun 2017 18:15:35 -0700 Subject: [PATCH] Skin: Don't use parser cache in getCachedNotice() Just use wfGetCache( CACHE_ANYTHING ) which should be sufficient for most cases. Change-Id: Ic97549c9649d0cc1938773b10e26f6e8f819c7fa --- includes/skins/Skin.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index ccb202e65a..e9d2f076b1 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1485,7 +1485,7 @@ abstract class Skin extends ContextSource { * should fall back to the next notice in its sequence */ private function getCachedNotice( $name ) { - global $wgRenderHashAppend, $parserMemc, $wgContLang; + global $wgRenderHashAppend, $wgContLang; $needParse = false; @@ -1506,9 +1506,10 @@ abstract class Skin extends ContextSource { $notice = $msg->plain(); } + $cache = wfGetCache( CACHE_ANYTHING ); // Use the extra hash appender to let eg SSL variants separately cache. - $key = $parserMemc->makeKey( $name . $wgRenderHashAppend ); - $cachedNotice = $parserMemc->get( $key ); + $key = $cache->makeKey( $name . $wgRenderHashAppend ); + $cachedNotice = $cache->get( $key ); if ( is_array( $cachedNotice ) ) { if ( md5( $notice ) == $cachedNotice['hash'] ) { $notice = $cachedNotice['html']; @@ -1521,7 +1522,7 @@ abstract class Skin extends ContextSource { if ( $needParse ) { $parsed = $this->getOutput()->parse( $notice ); - $parserMemc->set( $key, [ 'html' => $parsed, 'hash' => md5( $notice ) ], 600 ); + $cache->set( $key, [ 'html' => $parsed, 'hash' => md5( $notice ) ], 600 ); $notice = $parsed; } -- 2.20.1