* (bug 19849) Custom X-Vary-Options header now disabled unless $wgUseXVO is set
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 24 Jul 2009 20:01:23 +0000 (20:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 24 Jul 2009 20:01:23 +0000 (20:01 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/OutputPage.php

index e389e02..1cf190a 100644 (file)
@@ -327,6 +327,7 @@ this. Was used when mwEmbed was going to be an extension.
   when using long urls
 * The display of the language list on the preferences is more comply with the 
   BCP 47 standards.
+* (bug 19849) Custom X-Vary-Options header now disabled unless $wgUseXVO is set
 
 == API changes in 1.16 ==
 
index f2e85df..a25af35 100644 (file)
@@ -1690,6 +1690,9 @@ $wgUseSquid = false;
 /** If you run Squid3 with ESI support, enable this (default:false): */
 $wgUseESI = false;
 
+/** Send X-Vary-Options header for better caching (requires patched Squid) */
+$wgUseXVO = false;
+
 /** Internal server name as known to Squid, if different */
 # $wgInternalServer = 'http://yourinternal.tld:8000';
 $wgInternalServer = $wgServer;
index 8d80657..93318e6 100644 (file)
@@ -977,7 +977,7 @@ class OutputPage {
        }
 
        public function sendCacheControl() {
-               global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest;
+               global $wgUseSquid, $wgUseESI, $wgUseETag, $wgSquidMaxage, $wgRequest, $wgUseXVO;
 
                $response = $wgRequest->response();
                if ($wgUseETag && $this->mETag)
@@ -987,8 +987,10 @@ class OutputPage {
                # maintain different caches for logged-in users and non-logged in ones
                $response->header( 'Vary: Accept-Encoding, Cookie' );
 
-               # Add an X-Vary-Options header for Squid with Wikimedia patches
-               $response->header( $this->getXVO() );
+               if ( $wgUseXVO ) {
+                       # Add an X-Vary-Options header for Squid with Wikimedia patches
+                       $response->header( $this->getXVO() );
+               }
 
                if( !$this->uncacheableBecauseRequestVars() && $this->mEnableClientCache ) {
                        if( $wgUseSquid && session_id() == '' &&