Index: trunk/phase3/includes/cache/HTMLFileCache.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | public function __construct( $title, $type = 'view' ) { |
32 | 32 | $this->mTitle = $title; |
33 | | - $this->mType = ($type == 'raw' || $type == 'view' ) ? $type : false; |
| 33 | + $this->mType = ( $type == 'view' ) ? $type : false; |
34 | 34 | $this->fileCacheName(); // init name |
35 | 35 | } |
36 | 36 | |
— | — | @@ -45,8 +45,8 @@ |
46 | 46 | throw new MWException( 'Please set $wgCacheDirectory in LocalSettings.php if you wish to use the HTML file cache' ); |
47 | 47 | } |
48 | 48 | |
49 | | - # Store raw pages (like CSS hits) elsewhere |
50 | | - $subdir = ($this->mType === 'raw') ? 'raw/' : ''; |
| 49 | + # Store other views of aspects of pages elsewhere |
| 50 | + $subdir = ($this->mType === 'view') ? '' : "{$this->mType}/"; |
51 | 51 | |
52 | 52 | $key = $this->mTitle->getPrefixedDbkey(); |
53 | 53 | if ( $wgFileCacheDepth > 0 ) { |
— | — | @@ -92,15 +92,13 @@ |
93 | 93 | $queryVals = $wgRequest->getValues(); |
94 | 94 | foreach( $queryVals as $query => $val ) { |
95 | 95 | if( $query == 'title' || $query == 'curid' ) { |
96 | | - continue; |
| 96 | + continue; // note: curid sets title |
97 | 97 | // Normal page view in query form can have action=view. |
98 | 98 | // Raw hits for pages also stored, like .css pages for example. |
99 | 99 | } elseif( $query == 'action' && $val == 'view' ) { |
100 | 100 | continue; |
101 | | - } elseif( $query == 'usemsgcache' && $val == 'yes' ) { |
102 | | - continue; |
103 | 101 | // Below are header setting params |
104 | | - } elseif( $query == 'maxage' || $query == 'smaxage' || $query == 'ctype' || $query == 'gen' ) { |
| 102 | + } elseif( $query == 'maxage' || $query == 'smaxage' ) { |
105 | 103 | continue; |
106 | 104 | } else { |
107 | 105 | return false; |
— | — | @@ -158,14 +156,9 @@ |
159 | 157 | global $wgOut, $wgMimeType, $wgLanguageCode; |
160 | 158 | wfDebug( __METHOD__ . "()\n"); |
161 | 159 | $filename = $this->fileCacheName(); |
162 | | - // Raw pages should handle cache control on their own, |
163 | | - // even when using file cache. This reduces hits from clients. |
164 | | - if( $this->mType !== 'raw' ) { |
165 | | - $wgOut->sendCacheControl(); |
166 | | - header( "Content-Type: $wgMimeType; charset=UTF-8" ); |
167 | | - header( "Content-Language: $wgLanguageCode" ); |
168 | | - } |
169 | | - |
| 160 | + $wgOut->sendCacheControl(); |
| 161 | + header( "Content-Type: $wgMimeType; charset=UTF-8" ); |
| 162 | + header( "Content-Language: $wgLanguageCode" ); |
170 | 163 | if( $this->useGzip() ) { |
171 | 164 | if( wfClientAcceptsGzip() ) { |
172 | 165 | header( 'Content-Encoding: gzip' ); |
— | — | @@ -240,9 +233,6 @@ |
241 | 234 | $fc = new self( $title, 'view' ); |
242 | 235 | unlink( $fc->fileCacheName() ); |
243 | 236 | |
244 | | - $fc = new self( $title, 'raw' ); |
245 | | - unlink( $fc->fileCacheName() ); |
246 | | - |
247 | 237 | wfRestoreWarnings(); |
248 | 238 | |
249 | 239 | return true; |