FileCache - Leave raw page cache control alone to avoid hits
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 28 Dec 2008 15:14:15 +0000 (15:14 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 28 Dec 2008 15:14:15 +0000 (15:14 +0000)
includes/HTMLFileCache.php
index.php

index 7eca798..c23ed84 100644 (file)
@@ -131,7 +131,9 @@ class HTMLFileCache {
                wfDebug(" loadFromFileCache()\n");
 
                $filename = $this->fileCacheName();
-               $wgOut->sendCacheControl();
+               // Raw pages will handle control on their own
+               if( $this->mType !== 'raw' )
+                       $wgOut->sendCacheControl();
 
                header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
                header( "Content-language: $wgContLanguageCode" );
index 1418264..4cc6d6b 100644 (file)
--- a/index.php
+++ b/index.php
@@ -75,7 +75,9 @@ if( $wgUseAjax && $action == 'ajax' ) {
 
 if( $wgUseFileCache && isset($wgTitle) ) {
        wfProfileIn( 'main-try-filecache' );
-       if( HTMLFileCache::useFileCache() ) {
+       // Raw pages should handle control on their own
+       // even when using file cache.
+       if( $action != 'raw' && HTMLFileCache::useFileCache() ) {
                /* Try low-level file cache hit */
                $cache = new HTMLFileCache( $wgTitle, $action );
                if( $cache->isFileCacheGood( /* Assume up to date */ ) ) {