protected function sendCacheHeaders() {
global $wgUseXVO, $wgVaryOnXFP;
$response = $this->getRequest()->response();
+ $out = $this->getOutput();
+
+ if ( $wgVaryOnXFP ) {
+ $out->addVaryHeader( 'X-Forwarded-Proto' );
+ }
if ( $this->mCacheMode == 'private' ) {
$response->header( 'Cache-Control: private' );
}
if ( $this->mCacheMode == 'anon-public-user-private' ) {
- $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : '';
- $response->header( 'Vary: Accept-Encoding, Cookie' . $xfp );
+ $out->addVaryHeader( 'Cookie' );
+ $response->header( $out->getVaryHeader() );
if ( $wgUseXVO ) {
- $out = $this->getOutput();
- if ( $wgVaryOnXFP ) {
- $out->addVaryHeader( 'X-Forwarded-Proto' );
- }
$response->header( $out->getXVO() );
if ( $out->haveCacheVaryCookies() ) {
// Logged in, mark this request private
}
// Send public headers
- if ( $wgVaryOnXFP ) {
- $response->header( 'Vary: Accept-Encoding, X-Forwarded-Proto' );
- if ( $wgUseXVO ) {
- // Bleeeeegh. Our header setting system sucks
- $response->header( 'X-Vary-Options: Accept-Encoding;list-contains=gzip, X-Forwarded-Proto' );
- }
+ $response->header( $out->getVaryHeader() );
+ if ( $wgUseXVO ) {
+ $response->header( $out->getXVO() );
}
// If nobody called setCacheMaxAge(), use the (s)maxage parameters