Lifting a ban

Ben Truitt btruitt at rackspace.com
Thu Jul 7 21:45:46 CEST 2011


Here is a more comprehensive explanation in case it is helpful:

http://kristianlyng.wordpress.com/2010/07/28/smart-bans-with-varnish/

-Ben

On Jul 7, 2011, at 6:35 AM, Poul-Henning Kamp wrote:

> 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.
> 
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

This email may include confidential information. If you received it in error, please delete it.





More information about the varnish-misc mailing list