* (bug 5475) New pages feeds ignore "limit" argument
* (bug 5184) CSS misapplied to elements in Special:Allmessages due to conflicting
anchor identifiers
+* (bug 5519) Allow sidebar cache to be disabled; disable it by default.
+
== Compatibility ==
*/
$wgEnableParserCache = true;
+/**
+ * If on, the sidebar navigation links are cached for users with the
+ * current language set. This can save a touch of load on a busy site
+ * by shaving off extra message lookups.
+ *
+ * However it is also fragile: changing the site configuration, or
+ * having a variable $wgArticlePath, can produce broken links that
+ * don't update as expected.
+ */
+$wgEnableSidebarCache = false;
+
/**
* Under which condition should a page in the main namespace be counted
* as a valid article? If $wgUseCommaCount is set to true, it will be
* @access private
*/
function buildSidebar() {
- global $wgDBname, $parserMemc;
+ global $wgDBname, $parserMemc, $wgEnableSidebarCache;
global $wgLanguageCode, $wgContLanguageCode;
$fname = 'SkinTemplate::buildSidebar';
wfProfileIn( $fname );
- if ($wgLanguageCode == $wgContLanguageCode)
- $cacheSidebar = true;
- else
- $cacheSidebar = false;
+ $key = "{$wgDBname}:sidebar";
+ $cacheSidebar = $wgEnableSidebarCache &&
+ ($wgLanguageCode == $wgContLanguageCode);
if ($cacheSidebar) {
- $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
+ $cachedsidebar = $parserMemc->get( $key );
if ($cachedsidebar!="") {
wfProfileOut($fname);
return $cachedsidebar;
}
}
if ($cacheSidebar)
- $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
+ $cachednotice = $parserMemc->set( $key, $bar, 86400 );
wfProfileOut( $fname );
return $bar;
}