Configurable expiry time for the sidebar cache
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 9 Feb 2008 09:11:45 +0000 (09:11 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 9 Feb 2008 09:11:45 +0000 (09:11 +0000)
includes/DefaultSettings.php
includes/Skin.php

index 446b439..1fa5c75 100644 (file)
@@ -1012,6 +1012,11 @@ $wgEnableParserCache = true;
  */
 $wgEnableSidebarCache = false;
 
+/**
+ * Expiry time for the sidebar cache, in seconds
+ */
+$wgSidebarCacheExpiry = 86400;
+
 /**
  * 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
index bb22247..30d2c2b 100644 (file)
@@ -1602,7 +1602,7 @@ END;
         * @private
         */
        function buildSidebar() {
-               global $parserMemc, $wgEnableSidebarCache;
+               global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
                global $wgLang, $wgContLang;
 
                $fname = 'SkinTemplate::buildSidebar';
@@ -1663,7 +1663,7 @@ END;
                        }
                }
                if ($cacheSidebar)
-                       $parserMemc->set( $key, $bar, 86400 );
+                       $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
                wfProfileOut( $fname );
                return $bar;
        }