jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/358225 )

Change subject: Skin: Don't use parser cache in getCachedNotice()
......................................................................


Skin: Don't use parser cache in getCachedNotice()

Just use wfGetCache( CACHE_ANYTHING ) which should be sufficient for
most cases.

Change-Id: Ic97549c9649d0cc1938773b10e26f6e8f819c7fa
---
M includes/skins/Skin.php
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Tim Starling: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index ccb202e..e9d2f07 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -1485,7 +1485,7 @@
         *   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 @@
                        $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 @@
 
                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;
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/358225
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic97549c9649d0cc1938773b10e26f6e8f819c7fa
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to