Converted sidebar cache to the WAN cache
Bug: T93141 Change-Id: Id99f886c48501bbfef85cb0e7c5d2e2810a68581
This commit is contained in:
parent
4b23f54d40
commit
e9a609c7af
2 changed files with 6 additions and 5 deletions
4
includes/cache/MessageCache.php
vendored
4
includes/cache/MessageCache.php
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ) );
|
||||
|
|
|
|||
Loading…
Reference in a new issue