Cache slow special pages allpages, lonelypages, longpages, shortpages, watnedpages
[lhc/web/wiklou.git] / includes / SpecialShortpages.php
index 57efef4..76e18ed 100644 (file)
@@ -6,9 +6,14 @@ function wfSpecialShortpages()
        global $limit, $offset; # From query string
        $fname = "wfSpecialShortpages";
 
+       # Cache
+       $vsp = $wgLang->getValidSpecialPages();
+       $log = new LogPage( $vsp["Shortpages"] );
+       $log->mUpdateRecentChanges = false;
+
        global $wgMiserMode;
        if ( $wgMiserMode ) {
-               $wgOut->addWikiText( wfMsg( "perfdisabled" ) );
+               $log->showAsDisabledPage();
                return;
        }
 
@@ -41,6 +46,11 @@ function wfSpecialShortpages()
        $s .= "</ol>";
        $wgOut->addHTML( $s );
        $wgOut->addHTML( "<p>{$sl}\n" );
+
+
+       # Saving cache
+       if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable
+       $log->replaceContent( $s );
 }
 
 ?>