Converted sidebar cache to the WAN cache

Bug: T93141
Change-Id: Id99f886c48501bbfef85cb0e7c5d2e2810a68581
This commit is contained in:
Aaron Schulz 2015-04-27 14:56:52 -07:00
parent 4b23f54d40
commit e9a609c7af
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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 ) );