(bug 24124) Diffs are taking 10 to 20 seconds to load. Use parser cache for page...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 8 Jul 2010 17:01:28 +0000 (17:01 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 8 Jul 2010 17:01:28 +0000 (17:01 +0000)
includes/diff/DifferenceInterface.php

index 617f39a..d44823c 100644 (file)
@@ -421,8 +421,10 @@ CONTROL;
                        $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", 'rev-deleted-text-view' );
                }
 
+               $pCache = true;
                if( !$this->mNewRev->isCurrent() ) {
                        $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
+                       $pCache = false;
                }
 
                $this->loadNewText();
@@ -441,6 +443,13 @@ CONTROL;
                                $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) );
                                $wgOut->addHTML( "\n</pre>\n" );
                        }
+               } elseif( $pCache ) {
+                       $pOutput = ParserCache::singleton()->get( new Article( $this->mTitle ), $wgUser );
+                       if( $pOutput ) {
+                               $wgOut->addHtml( $pOutput->getText() );
+                       } else {
+                               $wgOut->addWikiTextTidy( $this->mNewtext );
+                       }
                } else {
                        $wgOut->addWikiTextTidy( $this->mNewtext );
                }