r45128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45127‎ | r45128 | r45129 >
Date:15:14, 28 December 2008
Author:aaron
Status:ok
Tags:
Comment:
FileCache - Leave raw page cache control alone to avoid hits
Modified paths:
  • /trunk/phase3/includes/HTMLFileCache.php (modified) (history)
  • /trunk/phase3/index.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HTMLFileCache.php
@@ -131,7 +131,9 @@
132132 wfDebug(" loadFromFileCache()\n");
133133
134134 $filename = $this->fileCacheName();
135 - $wgOut->sendCacheControl();
 135+ // Raw pages will handle control on their own
 136+ if( $this->mType !== 'raw' )
 137+ $wgOut->sendCacheControl();
136138
137139 header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
138140 header( "Content-language: $wgContLanguageCode" );
Index: trunk/phase3/index.php
@@ -75,7 +75,9 @@
7676
7777 if( $wgUseFileCache && isset($wgTitle) ) {
7878 wfProfileIn( 'main-try-filecache' );
79 - if( HTMLFileCache::useFileCache() ) {
 79+ // Raw pages should handle control on their own
 80+ // even when using file cache.
 81+ if( $action != 'raw' && HTMLFileCache::useFileCache() ) {
8082 /* Try low-level file cache hit */
8183 $cache = new HTMLFileCache( $wgTitle, $action );
8284 if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {

Status & tagging log