Rename $wgPurgeHttp11 to $wgSquidPurgeUseHostHeader
authorTim Starling <tstarling@wikimedia.org>
Mon, 15 Oct 2012 00:14:26 +0000 (11:14 +1100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 15 Oct 2012 00:58:07 +0000 (00:58 +0000)
Rename $wgPurgeHttp11 to $wgSquidPurgeUseHostHeader, set it to true by
default, and update the documentation per the research I've done on
Squid's behaviour. See bug 39005.

Rewrote the release note and moved it to the correct section.

Change-Id: I9ef6a0c43fc1ba4547b34124a47815296f45b20e

RELEASE-NOTES-1.21
includes/DefaultSettings.php
includes/SquidPurgeClient.php

index b9fc458..d8f6506 100644 (file)
@@ -14,9 +14,6 @@ production.
 * (bug 29374) $wgVectorUseSimpleSearch is now enabled by default.
 * Deprecated $wgAllowRealName is removed. Use $wgHiddenPrefs[] = 'realname'
   instead.
-* Added a $wgPurgeHttp11 setting to allow SquidPurgeClient to send PURGE requests
-  using HTTP/1.1 and a Host header instead of sending HTTP/1.0 requests with the
-  whole url inside the PURGE <...> HTTP/1.0 line.
 
 === New features in 1.21 ===
 * (bug 34876) jquery.makeCollapsible has been improved in performance.
@@ -38,6 +35,11 @@ production.
   recentchanges table.
 * (bug 32951) Do not register internal externals with absolute protocol,
   when server has relative protocol.
+* (bug 39005) When purging proxies listed in $wgSquidServers using HTTP PURGE 
+  method requests, we now send a Host header by default, for Varnish 
+  compatibility. This also works with Squid in reverse-proxy mode. If you wish 
+  to support Squid configured in forward-proxy mode, set 
+  $wgSquidPurgeUseHostHeader to false.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
index 598c346..320ce62 100644 (file)
@@ -2059,12 +2059,25 @@ $wgSquidServersNoPurge = array();
 $wgMaxSquidPurgeTitles = 400;
 
 /**
- * Whether to use HTTP/1.1 for squid purge requests
- * false - Use HTTP/1.0 with a full url in the PURGE request.
- * true - Use HTTP/1.1 with a Host header and PURGE path.
- * @since 1.20
+ * Whether to use a Host header in purge requests sent to the proxy servers
+ * configured in $wgSquidServers. Set this to false to support Squid 
+ * configured in forward-proxy mode.
+ *
+ * If this is set to true, a Host header will be sent, and only the path
+ * component of the URL will appear on the request line, as if the request
+ * were a non-proxy HTTP 1.1 request. Varnish only supports this style of 
+ * request. Squid supports this style of request only if reverse-proxy mode
+ * (http_port ... accel) is enabled.
+ *
+ * If this is set to false, no Host header will be sent, and the absolute URL
+ * will be sent in the request line, as is the standard for an HTTP proxy
+ * request in both HTTP 1.0 and 1.1. This style of request is not supported
+ * by Varnish, but is supported by Squid in either configuration (forward or
+ * reverse). 
+ *
+ * @since 1.21
  */
-$wgPurgeHttp11 = false;
+$wgSquidPurgeUseHostHeader = true;
 
 /**
  * Routing configuration for HTCP multicast purging. Add elements here to
index cb33ead..7d75f2c 100644 (file)
@@ -176,10 +176,10 @@ class SquidPurgeClient {
         * @param $url string
         */
        public function queuePurge( $url ) {
-               global $wgPurgeHttp11;
+               global $wgSquidPurgeUseHostHeader;
                $url = SquidUpdate::expand( str_replace( "\n", '', $url ) );
                $request = array();
-               if ( $wgPurgeHttp11 ) {
+               if ( $wgSquidPurgeUseHostHeader ) {
                        $url = wfParseUrl( $url );
                        $host = $url['host'];
                        if ( isset( $url['port'] ) && strlen( $url['port'] ) > 0 ) {