diff options
author | Brion Vibber <brion@users.mediawiki.org> | 2003-05-16 11:19:06 +0000 |
---|---|---|
committer | Brion Vibber <brion@users.mediawiki.org> | 2003-05-16 11:19:06 +0000 |
commit | 0dbedf1c7b340a2e5db96e02c6e0e883ab1b6a12 (patch) | |
tree | 4e495fc494fa6de09da486ea8574f1649a91329d /includes/SpecialLongpages.php | |
parent | 92ea39aa9f6aa2ea72579828d0f1a720b4457bef (diff) | |
download | mediawikicore-0dbedf1c7b340a2e5db96e02c6e0e883ab1b6a12.tar.gz mediawikicore-0dbedf1c7b340a2e5db96e02c6e0e883ab1b6a12.zip |
Cache slow special pages allpages, lonelypages, longpages, shortpages, watnedpages
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/1319
Diffstat (limited to 'includes/SpecialLongpages.php')
-rw-r--r-- | includes/SpecialLongpages.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/includes/SpecialLongpages.php b/includes/SpecialLongpages.php index 3807abdb2d8c..e45e22c79a38 100644 --- a/includes/SpecialLongpages.php +++ b/includes/SpecialLongpages.php @@ -6,9 +6,14 @@ function wfSpecialLongpages() global $limit, $offset; # From query string $fname = "wfSpecialLongpages"; + # Cache + $vsp = $wgLang->getValidSpecialPages(); + $log = new LogPage( $vsp["Longpages"] ); + $log->mUpdateRecentChanges = false; + global $wgMiserMode; if ( $wgMiserMode ) { - $wgOut->addWikiText( wfMsg( "perfdisabled" ) ); + $log->showAsDisabledPage(); return; } @@ -42,6 +47,10 @@ function wfSpecialLongpages() $s .= "</ol>"; $wgOut->addHTML( $s ); $wgOut->addHTML( "<p>{$sl}\n" ); + + # Saving cache + if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable + $log->replaceContent( $s ); } ?> |