From b2c5dce7d720a8fdcd5e2150beba700bf373dec4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 9 Dec 2008 11:41:31 +0000 Subject: [PATCH] Speed up filecache a tad --- includes/Article.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index cbed4d516f..07fce769bf 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -674,7 +674,6 @@ class Article { global $wgEnableParserCache, $wgStylePath, $wgParser; global $wgUseTrackbacks, $wgNamespaceRobotPolicies, $wgArticleRobotPolicies; global $wgDefaultRobotPolicy; - $sk = $wgUser->getSkin(); wfProfileIn( __METHOD__ ); @@ -684,6 +683,23 @@ class Article { # Get variables from query string $oldid = $this->getOldID(); + # Try file cache + if( $oldid === 0 && $this->checkTouched() ) { + $wgOut->setETag($parserCache->getETag($this, $wgUser)); + if( $wgOut->checkLastModified( $this->getTouched() ) ){ + wfProfileOut( __METHOD__ ); + return; + } else if( $this->tryFileCache() ) { + # tell wgOut that output is taken care of + $wgOut->disable(); + $this->viewUpdates(); + wfProfileOut( __METHOD__ ); + return; + } + } + + $sk = $wgUser->getSkin(); + # getOldID may want us to redirect somewhere else if( $this->mRedirectUrl ) { $wgOut->redirect( $this->mRedirectUrl ); @@ -735,21 +751,6 @@ class Article { return; } - if( empty( $oldid ) && $this->checkTouched() ) { - $wgOut->setETag($parserCache->getETag($this, $wgUser)); - - if( $wgOut->checkLastModified( $this->mTouched ) ){ - wfProfileOut( __METHOD__ ); - return; - } else if( $this->tryFileCache() ) { - # tell wgOut that output is taken care of - $wgOut->disable(); - $this->viewUpdates(); - wfProfileOut( __METHOD__ ); - return; - } - } - # Should the parser cache be used? $pcache = $this->useParserCache( $oldid ); wfDebug( 'Article::view using parser cache: ' . ($pcache ? 'yes' : 'no' ) . "\n" ); -- 2.20.1