Bans vs. Purges (was RE: lurker?)
ck-lists at cksoft.de
Thu Jun 30 13:17:05 CEST 2011
On Thu, 30 Jun 2011, Lars Jørgensen wrote:
>>> Is that really the case? According to the documentation, both concepts still exists. As I understand them, a ban
>>> is a permanent filter, a purge is a deletion of cache object(s).
>> No. Bans are not permanent. They are *lazy*. They are applied at a later time, when the relevant object is
>> requested. If the object is *newer* than the ban the band doesn't apply.
> Please walk me through an example like this:
> 1. User requests index.html, it's a miss, so varnish fetches it, stores it in the cache and delivers it
> 2. I ban index.html
> 3. User requests index.html. The current object in the cache is banned, so a new version is fetched, stored and deliverd
> 4. User requests index.html. There are two of those in the cache, but one is older than the ban, so it will not be served.
> What is the purpose of banning an object when you could just delete it? The way I understand it, when a ban is in effect, multiple copies of the same object will exist in the cache, and varnish has to check a ban list to find out which ones to serve. Seems a convoluted way of doing things, but I suspect I'm missing a major point somewhere.
the purpose of the ban.list is to avoid walking through potentially hundreds of thousands of objects and finding the correct once to delete. Adding the expression to a short list to check on every hit is by far the smaller cost.
This has the same effect as deleting the respective objects from the cache. It's just cheaper for varnish.
> I'm sorry for wasting time if everybody else understands this, but it is puzzling to me.
Christian Kratzer CK Software GmbH
Email: ck at cksoft.de Wildberger Weg 24/2
Phone: +49 7032 893 997 - 0 D-71126 Gaeufelden
Fax: +49 7032 893 997 - 9 HRB 245288, Amtsgericht Stuttgart
Web: http://www.cksoft.de/ Geschaeftsfuehrer: Christian Kratzer
More information about the varnish-misc