Lifting a ban
Poul-Henning Kamp
phk at phk.freebsd.dk
Thu Jul 7 12:35:10 CEST 2011
In message <6D2C830A0941EA40B6B483FE6EC98ADB1874E21C at EXCHANGE-01.kb.dk>, =?iso-
8859-1?Q?Lars_J=F8rgensen?= writes:
>When I issue a ban in varnishadm to invalidate a series of urls in the cache,
>when will this ban be lifted?
When all objects in the cache at the time you issued the ban has either
been tested against it, or expired.
We have a "ban-lurker" thread which tries to speed this process up
by testing objects against the bans, but since there is no request
available, this thread can only test obj.* conditions, but not
req.* conditions.
One way to work around this limitation is to copy the fields you
want to test from req into obj:
sub vcl_fetch {
// copy url to object fo ban lurker
set beresp.http.XYZ-url = req.url;
}
sub vcl_deliver {
// don't deliver url to client
unset resp.http.XYZ-url;
}
ban obj.http.xyz-url ~ "*.jpg"
--
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