From: Aaron Schulz Date: Sun, 28 Dec 2008 15:03:57 +0000 (+0000) Subject: FileCache tweaks: X-Git-Tag: 1.31.0-rc.0~43722 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=0dd5d00e67ca11ca0112e2886b10f0621a3ab98f;p=lhc%2Fweb%2Fwiklou.git FileCache tweaks: * Fix typo self -> MediaWiki * View updates run on client cache hits * Removed unneeded $wgOut->disable() call * Disabled unused output on rawpage cache hits * Removed redundant checkLastModified() --- diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index 3f27d448ac..7eca7989e9 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -24,6 +24,7 @@ class HTMLFileCache { public function __construct( &$title, $type = 'view' ) { $this->mTitle = $title; + $type = $type ? $type : 'view'; $this->mType = ($type == 'raw' || $type == 'view' ) ? $type : false; $this->fileCacheName(); // init name } diff --git a/includes/RawPage.php b/includes/RawPage.php index a7bc02c14c..5d5c081e1a 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -153,10 +153,8 @@ class RawPage { if( HTMLFileCache::useFileCache() ) { $cache = new HTMLFileCache( $this->mTitle, 'raw' ); if( $cache->isFileCacheGood( /* Assume up to date */ ) ) { - /* Check incoming headers to see if client has this cached */ - if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { - $cache->loadFromFileCache(); - } + $cache->loadFromFileCache(); + $wgOut->disable(); return; } else { ob_start( array(&$cache, 'saveToFileCache' ) ); diff --git a/index.php b/index.php index 460c0ec8a3..141826478c 100644 --- a/index.php +++ b/index.php @@ -82,12 +82,11 @@ if( $wgUseFileCache && isset($wgTitle) ) { /* Check incoming headers to see if client has this cached */ if( !$wgOut->checkLastModified( $cache->fileCacheTime() ) ) { $cache->loadFromFileCache(); - # Do any stats increment/watchlist stuff - $wgArticle = self::articleFromTitle( $wgTitle ); - $wgArticle->viewUpdates(); } + # Do any stats increment/watchlist stuff + $wgArticle = MediaWiki::articleFromTitle( $wgTitle ); + $wgArticle->viewUpdates(); # Tell $wgOut that output is taken care of - $wgOut->disable(); wfProfileOut( 'main-try-filecache' ); $mediaWiki->restInPeace(); exit;