public function __construct( &$title, $type = 'view' ) {
$this->mTitle = $title;
- $type = $type ? $type : 'view';
$this->mType = ($type == 'raw' || $type == 'view' ) ? $type : false;
$this->fileCacheName(); // init name
}
wfDebug(" loadFromFileCache()\n");
$filename = $this->fileCacheName();
- $wgOut->sendCacheControl();
-
- header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
- header( "Content-language: $wgContLanguageCode" );
+ // 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={$wgOutputEncoding}" );
+ header( "Content-Language: $wgContLanguageCode" );
+ }
if( $this->useGzip() ) {
if( wfClientAcceptsGzip() ) {
public static function clearFileCache( $title ) {
global $wgUseFileCache;
if( !$wgUseFileCache ) return false;
- $fc = new self( $title, '' );
+ $fc = new self( $title, 'view' );
@unlink( $fc->fileCacheName() );
$fc = new self( $title, 'raw' );
@unlink( $fc->fileCacheName() );