Page MenuHomePhabricator

Varnish 2.x doesn't like full urls in PURGE requests
Closed, ResolvedPublic

Description

According to http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Varnish_purging_not_working_since_Varnish_2.x Varnish 2.x expects HTTP purge's to be of the form

PURGE foo HTTP/1.0
host: http://somewhere.com

instead of what we do which is:

PURGE http://somewhere.com/foo HTTP/1.0

We should investigate if this is true, and if so either change our SquidPurgeClient to do what varnish likes, or put in a config variable


Version: 1.20.x
Severity: normal
URL: http://www.mediawiki.org/wiki/Thread:Project:Support_desk/Varnish_purging_not_working_since_Varnish_2.x
See Also:
https://www.varnish-cache.org/trac/ticket/1255

Details

Reference
bz39005

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:54 AM
bzimport set Reference to bz39005.
bzimport added a subscriber: Unknown Object (MLST).

I already wrote the code to fix this and tried to submit it:
https://gerrit.wikimedia.org/r/#/c/4065/

But then it was rejected.

cc'ing hashar since he commented on that change in gerrit.

So just to clarify, we rejected the patch because we don't like the way another product interpreted the HTTP standard?

PURGE is not part of the HTTP standard. I am pretty sure Squid does not support virtual host for purge command and expect a full URL.

So we want a new class such as VarnishPurgeClient or something similar.

Squid supports the Host header in PURGE requests as long as reverse-proxy mode (i.e. http_port ... accel) is enabled, which it always should be if it is in $wgSquidServers. I've confirmed this back to Squid 2.6 in both vhost and defaultsite mode. So the Host header can be sent unconditionally, there's no need for a secret "make this work in Varnish" configuration variable.

(In reply to comment #5)

https://gerrit.wikimedia.org/r/#/c/4065/

Status Merged, bug resolved?

No feedback => assuming it's fixed.