* (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.
/** Maximum number of titles to purge in any one client operation */
$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
+ */
+$wgPurgeHttp11 = false;
+
/**
* Routing configuration for HTCP multicast purging. Add elements here to
* enable HTCP and determine which purges are sent where. If set to an empty
* @param $url string
*/
public function queuePurge( $url ) {
+ global $wgPurgeHttp11;
$url = SquidUpdate::expand( str_replace( "\n", '', $url ) );
- $this->requests[] = "PURGE $url HTTP/1.0\r\n" .
- "Connection: Keep-Alive\r\n" .
- "Proxy-Connection: Keep-Alive\r\n" .
- "User-Agent: " . Http::userAgent() . ' ' . __CLASS__ . "\r\n\r\n";
+ $request = array();
+ if ( $wgPurgeHttp11 ) {
+ $url = wfParseUrl( $url );
+ $host = $url['host'];
+ if ( isset( $url['port'] ) && strlen( $url['port'] ) > 0 ) {
+ $host .= ":" . $url['port'];
+ }
+ $path = $url['path'];
+ if ( isset( $url['query'] ) && is_string( $url['query'] ) ) {
+ $path = wfAppendQuery( $path, $url['query'] );
+ }
+ $request[] = "PURGE $path HTTP/1.1";
+ $request[] = "Host: $host";
+ } else {
+ $request[] = "PURGE $url HTTP/1.0";
+ }
+ $request[] = "Connection: Keep-Alive";
+ $request[] = "Proxy-Connection: Keep-Alive";
+ $request[] = "User-Agent: " . Http::userAgent() . ' ' . __CLASS__;
+ // Two ''s to create \r\n\r\n
+ $request[] = '';
+ $request[] = '';
+
+ $this->requests[] = implode( "\r\n", $request );
if ( $this->currentRequestIndex === null ) {
$this->nextRequest();
}