From 7fa47e0c8f230194aa8d392e94e15c3396c06d28 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 24 Sep 2011 00:37:11 +0000 Subject: [PATCH] Removed action=raw support from HTMLFileCache. Obsolete due to RL. --- includes/cache/HTMLFileCache.php | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index f981999a35..9b63e2cd50 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -29,7 +29,7 @@ class HTMLFileCache { public function __construct( $title, $type = 'view' ) { $this->mTitle = $title; - $this->mType = ($type == 'raw' || $type == 'view' ) ? $type : false; + $this->mType = ( $type == 'view' ) ? $type : false; $this->fileCacheName(); // init name } @@ -45,8 +45,8 @@ class HTMLFileCache { throw new MWException( 'Please set $wgCacheDirectory in LocalSettings.php if you wish to use the HTML file cache' ); } - # Store raw pages (like CSS hits) elsewhere - $subdir = ($this->mType === 'raw') ? 'raw/' : ''; + # Store other views of aspects of pages elsewhere + $subdir = ($this->mType === 'view') ? '' : "{$this->mType}/"; $key = $this->mTitle->getPrefixedDbkey(); if ( $wgFileCacheDepth > 0 ) { @@ -92,15 +92,13 @@ class HTMLFileCache { $queryVals = $wgRequest->getValues(); foreach( $queryVals as $query => $val ) { if( $query == 'title' || $query == 'curid' ) { - continue; + continue; // note: curid sets title // Normal page view in query form can have action=view. // Raw hits for pages also stored, like .css pages for example. } elseif( $query == 'action' && $val == 'view' ) { continue; - } elseif( $query == 'usemsgcache' && $val == 'yes' ) { - continue; // Below are header setting params - } elseif( $query == 'maxage' || $query == 'smaxage' || $query == 'ctype' || $query == 'gen' ) { + } elseif( $query == 'maxage' || $query == 'smaxage' ) { continue; } else { return false; @@ -158,14 +156,9 @@ class HTMLFileCache { global $wgOut, $wgMimeType, $wgLanguageCode; wfDebug( __METHOD__ . "()\n"); $filename = $this->fileCacheName(); - // Raw pages should handle cache control on their own, - // even when using file cache. This reduces hits from clients. - if( $this->mType !== 'raw' ) { - $wgOut->sendCacheControl(); - header( "Content-Type: $wgMimeType; charset=UTF-8" ); - header( "Content-Language: $wgLanguageCode" ); - } - + $wgOut->sendCacheControl(); + header( "Content-Type: $wgMimeType; charset=UTF-8" ); + header( "Content-Language: $wgLanguageCode" ); if( $this->useGzip() ) { if( wfClientAcceptsGzip() ) { header( 'Content-Encoding: gzip' ); @@ -240,9 +233,6 @@ class HTMLFileCache { $fc = new self( $title, 'view' ); unlink( $fc->fileCacheName() ); - $fc = new self( $title, 'raw' ); - unlink( $fc->fileCacheName() ); - wfRestoreWarnings(); return true; -- 2.20.1