diff --git a/includes/specialpage/SpecialPage.php b/includes/specialpage/SpecialPage.php index 6624414f72c..f478203019b 100644 --- a/includes/specialpage/SpecialPage.php +++ b/includes/specialpage/SpecialPage.php @@ -186,12 +186,14 @@ class SpecialPage { * false to use the parent page's cache settings */ public function maxIncludeCacheTime() { - global $wgMiserMode; - if ( !$wgMiserMode ) { - return 0; - } else { - return 60*60; - } + return $this->getConfig()->get( 'MiserMode' ) ? $this->getCacheTTL() : 0; + } + + /** + * @return int Seconds that this page can be cached + */ + protected function getCacheTTL() { + return 60 * 60; } /** diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index ff9a8990eb0..41890f2ca7e 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -479,17 +479,7 @@ class SpecialNewpages extends IncludableSpecialPage { return 'changes'; } - /** - * How long to cache page when it is being included. - * - * @return int Time in seconds, 0 to disable caching altogether - */ - public function maxIncludeCacheTime() { - global $wgMiserMode; - if ( !$wgMiserMode ) { - return 0; - } else { - return 60*5; - } + protected function getCacheTTL() { + return 60 * 5; } } diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 36ccd4ae4b2..00e07bdc8d1 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -795,18 +795,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage { return true; } - /** - * How long to cache page when it is being included. - * - * @return int|bool Time in seconds, 0 to disable caching altogether - */ - public function maxIncludeCacheTime() { - global $wgMiserMode; - if ( !$wgMiserMode ) { - return 0; - } else { - return 60*5; - } + protected function getCacheTTL() { + return 60 * 50; } }