From 97522367b236ec55d72cd4a76d2f6c1ddabe92ec Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 9 Feb 2008 10:01:35 +0000 Subject: [PATCH] Reset the message cache on action=purge of a MediaWiki namespace page. Delete the sidebar cache *after* the message cache is updated, not before. If you delete it before then the same version might get cached again. --- includes/Article.php | 5 +++++ includes/MessageCache.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index 3f17c01e4c..188aee1ed5 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -978,6 +978,11 @@ class Article { $update = SquidUpdate::newSimplePurge( $this->mTitle ); $update->doUpdate(); } + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { + global $wgMessageCache; + $text = $this->getContent(); + $wgMessageCache->replace( $this->mTitle->getDBkey(), $text ); + } $this->view(); } diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 743bd7f18b..976cd968f6 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -348,7 +348,6 @@ class MessageCache { wfProfileIn( __METHOD__ ); $this->lock(); $this->load(); - $parserMemc->delete(wfMemcKey('sidebar')); if ( is_array( $this->mCache ) ) { if ( $text === false ) { # Article was deleted @@ -376,6 +375,7 @@ class MessageCache { } } $this->unlock(); + $parserMemc->delete(wfMemcKey('sidebar')); wfProfileOut( __METHOD__ ); } -- 2.20.1