private $mFollowPolicy = 'follow';
private $mVaryHeader = array(
'Accept-Encoding' => array( 'list-contains=gzip' ),
- 'Cookie' => null
);
/**
$this->mVaryHeader[$header] = array_unique( (array)$this->mVaryHeader[$header] );
}
+ /**
+ * Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader,
+ * such as Accept-Encoding or Cookie
+ *
+ * @return String
+ */
+ public function getVaryHeader() {
+ return 'Vary: ' . join( ', ', array_keys( $this->mVaryHeader ) );
+ }
+
/**
* Get a complete X-Vary-Options header
*
$response->header( "ETag: $this->mETag" );
}
+ $this->addVaryHeader( 'Cookie' );
$this->addAcceptLanguage();
# don't serve compressed data to clients who can't handle it
# maintain different caches for logged-in users and non-logged in ones
- $response->header( 'Vary: ' . join( ', ', array_keys( $this->mVaryHeader ) ) );
+ $response->header( $this->getVaryHeader() );
if ( $wgUseXVO ) {
# Add an X-Vary-Options header for Squid with Wikimedia patches