Regarding url purging

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Jul 6 12:21:16 CEST 2007


In message <200707052013.24760.gaute at pht.no>, Gaute Amundsen writes:
>On Thursday 05 July 2007 19:39, Andr=E9 Cruz wrote:

>> I'm caching pages from different vhosts, say x.com and y.com.
>>
>> If I want to purge all the data from one of the vhosts how do I do
>> it? "url.purge x.com.*" does not work. I'm a bit confused with the
>> syntax since the wiki only talks about paths and not complete URLs.
>
>That's not easily done, as far as I have been able to determine.
>I've submitted a feature request for it..

And I've been thinking about it and may have come up with a solution:

When we hash, we hash on a string that by default contains

	req.http.host "#" req.url "#"

In your case for instance it owuld be:

	x.com#/#

It looks like purges need to (be able) match against this string,
rather than the url alone.

I'm not sure what the exact form of the solution will be, but I
may simply add another CLI command:

	hash.purge $regexp

That matches against the hash string.

The caveat of this is, that if the user customizes the hash string
with vcl_hash(), he has to take this into account with his purge
strings.

But I can see how that could be an advantage also: one could "tag"
object in vcl_hash with a class or token, which can later be used
to purge the tagged objects.

Do we have a ticket for this in trac already ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-misc mailing list