http purging multiple accept-encoding entries
checker at d6.com
Sat Jul 10 10:24:42 CEST 2010
Awesome, this worked great, thanks!
The one caveat that others might run into was that sometimes the backend
would sent / as the url, and I was using the regexp ~ version from the
link you sent, so it would clear the whole cache. I changed it to this:
purge("req.url ~ " req.url "$"); # use regexp to
handle all Accept-Encoding's
error 200 "Purged in recv.";
and now it works perfectly.
On 2010/07/09 04:56, Laurence Rowe wrote:
> On 9 July 2010 12:01, Chris Hecker<checker at d6.com> wrote:
>> I'm trying to put varnish in front of mediawiki, but there are a couple
>> things going wrong with the purging support built into mediawiki (which
>> supposedly supports varnish and squid).
>> 1. Mediawiki was sending back an HTTP/1.0 PURGE command, which had no Host:
>> header, just the full url after the PURGE, so the hash function wasn't
>> matching with the normal HTTP/1.1 requests. I patched mediawiki to fix this
>> and send an HTTP/1.1 PURGE with a Host: header, not sure what a better way
>> to do this would be.
>> 2. The PURGE does not have an Accept-encoding: on it, so it doesn't match
>> the cached object, which is almost always A-e: gzip. I hacked a gzip header
>> onto the PURGE, but what I really want is to purge all the records
>> associated with an URL. Is there a way to do this?
> See: http://varnish-cache.org/wiki/VCLExamplePurging
> Using purge("req.url == " req.url); should fix both problems.
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
More information about the varnish-misc