| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -751,6 +751,17 @@ |
| 752 | 752 | $wgEnableParserCache = true; |
| 753 | 753 | |
| 754 | 754 | /** |
| | 755 | + * If on, the sidebar navigation links are cached for users with the |
| | 756 | + * current language set. This can save a touch of load on a busy site |
| | 757 | + * by shaving off extra message lookups. |
| | 758 | + * |
| | 759 | + * However it is also fragile: changing the site configuration, or |
| | 760 | + * having a variable $wgArticlePath, can produce broken links that |
| | 761 | + * don't update as expected. |
| | 762 | + */ |
| | 763 | +$wgEnableSidebarCache = false; |
| | 764 | + |
| | 765 | +/** |
| 755 | 766 | * Under which condition should a page in the main namespace be counted |
| 756 | 767 | * as a valid article? If $wgUseCommaCount is set to true, it will be |
| 757 | 768 | * counted if it contains at least one comma. If it is set to false |
| Index: trunk/phase3/includes/Skin.php |
| — | — | @@ -1427,20 +1427,19 @@ |
| 1428 | 1428 | * @access private |
| 1429 | 1429 | */ |
| 1430 | 1430 | function buildSidebar() { |
| 1431 | | - global $wgDBname, $parserMemc; |
| | 1431 | + global $wgDBname, $parserMemc, $wgEnableSidebarCache; |
| 1432 | 1432 | global $wgLanguageCode, $wgContLanguageCode; |
| 1433 | 1433 | |
| 1434 | 1434 | $fname = 'SkinTemplate::buildSidebar'; |
| 1435 | 1435 | |
| 1436 | 1436 | wfProfileIn( $fname ); |
| 1437 | 1437 | |
| 1438 | | - if ($wgLanguageCode == $wgContLanguageCode) |
| 1439 | | - $cacheSidebar = true; |
| 1440 | | - else |
| 1441 | | - $cacheSidebar = false; |
| | 1438 | + $key = "{$wgDBname}:sidebar"; |
| | 1439 | + $cacheSidebar = $wgEnableSidebarCache && |
| | 1440 | + ($wgLanguageCode == $wgContLanguageCode); |
| 1442 | 1441 | |
| 1443 | 1442 | if ($cacheSidebar) { |
| 1444 | | - $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar"); |
| | 1443 | + $cachedsidebar = $parserMemc->get( $key ); |
| 1445 | 1444 | if ($cachedsidebar!="") { |
| 1446 | 1445 | wfProfileOut($fname); |
| 1447 | 1446 | return $cachedsidebar; |
| — | — | @@ -1476,7 +1475,7 @@ |
| 1477 | 1476 | } |
| 1478 | 1477 | } |
| 1479 | 1478 | if ($cacheSidebar) |
| 1480 | | - $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400); |
| | 1479 | + $cachednotice = $parserMemc->set( $key, $bar, 86400 ); |
| 1481 | 1480 | wfProfileOut( $fname ); |
| 1482 | 1481 | return $bar; |
| 1483 | 1482 | } |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -66,7 +66,9 @@ |
| 67 | 67 | * (bug 5475) New pages feeds ignore "limit" argument |
| 68 | 68 | * (bug 5184) CSS misapplied to elements in Special:Allmessages due to conflicting |
| 69 | 69 | anchor identifiers |
| | 70 | +* (bug 5519) Allow sidebar cache to be disabled; disable it by default. |
| 70 | 71 | |
| | 72 | + |
| 71 | 73 | == Compatibility == |
| 72 | 74 | |
| 73 | 75 | Older PHP 4.2 and 4.1 releases are no longer supported; PHP 4 users must |