From: Aaron Schulz Date: Mon, 27 Apr 2015 21:56:52 +0000 (-0700) Subject: Converted sidebar cache to the WAN cache X-Git-Tag: 1.31.0-rc.0~11461 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e9a609c7afbd0086a5c494dd3af07c603f6bbaab Converted sidebar cache to the WAN cache Bug: T93141 Change-Id: Id99f886c48501bbfef85cb0e7c5d2e2810a68581 --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index a55e25a343..31ee487504 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -554,10 +554,10 @@ class MessageCache { $codes = array_keys( Language::fetchLanguageNames() ); } - global $wgMemc; + $cache = ObjectCache::getMainWANInstance(); foreach ( $codes as $code ) { $sidebarKey = wfMemcKey( 'sidebar', $code ); - $wgMemc->delete( $sidebarKey ); + $cache->delete( $sidebarKey, 5 ); } // Update the message in the message blob store diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 07a2e87801..6c5fbcd338 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1234,12 +1234,13 @@ abstract class Skin extends ContextSource { * @return array */ function buildSidebar() { - global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry; + global $wgEnableSidebarCache, $wgSidebarCacheExpiry; + $cache = ObjectCache::getMainWANInstance(); $key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() ); if ( $wgEnableSidebarCache ) { - $cachedsidebar = $wgMemc->get( $key ); + $cachedsidebar = $cache->get( $key ); if ( $cachedsidebar ) { Hooks::run( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) ); @@ -1252,7 +1253,7 @@ abstract class Skin extends ContextSource { Hooks::run( 'SkinBuildSidebar', array( $this, &$bar ) ); if ( $wgEnableSidebarCache ) { - $wgMemc->set( $key, $bar, $wgSidebarCacheExpiry ); + $cache->set( $key, $bar, $wgSidebarCacheExpiry ); } Hooks::run( 'SidebarBeforeOutput', array( $this, &$bar ) );