http purging multiple accept-encoding entries
Chris Hecker
checker at d6.com
Sun Jul 11 01:39:17 CEST 2010
Ack, you're totally right. Brain was addled from 10 hours of server
nonsense! I will do the ==. Somebody should update the page.
Oh, wait, the reason I didn't do the == was because one backend sends a
full HTTP/1.0 style url in the PURGE, and the other sends a Host: and
just the relative path name. Hmm.
Chris
On 2010/07/10 07:22, Laurence Rowe wrote:
> That example is only for handling wildcard purges. The one above uses
> a direct comparison, which is what you want:
>
> purge("req.url == " req.url);
>
> Your regexp is not doing what you think it's doing either, purging "/"
> will purge "/foo/" and "/foo/bar/" as well. You need to anchor it to
> the beginning of the string too:
>
> purge("req.url ~ ^" req.url "$");
>
> This should allow wild card purges to work if you need them.
>
> Laurence
>
> On 10 July 2010 09:24, Chris Hecker<checker at d6.com> wrote:
>>
>> 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.
>>
>> Chris
>>
>>
>> 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.
>>>
>>> Laurence
>>>
>>> _______________________________________________
>>> varnish-misc mailing list
>>> varnish-misc at varnish-cache.org
>>> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
>>>
>>
>
More information about the varnish-misc
mailing list