From ba77d25db2f5b301458d6648a764e56c7905408d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 28 Dec 2008 15:14:15 +0000 Subject: [PATCH] FileCache - Leave raw page cache control alone to avoid hits --- includes/HTMLFileCache.php | 4 +++- index.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index 7eca7989e9..c23ed84e8c 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -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" ); diff --git a/index.php b/index.php index 141826478c..4cc6d6b1c7 100644 --- 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 */ ) ) { -- 2.20.1