On Thu, Jun 30, 2011 at 10:36:44AM +0000, Lars Jørgensen wrote: > > What was known as purges in Varnish 2.x is known as bans in 3.0, so a > > bit of confusion... > > 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).
In Varnish 2: - purge() from vcl AND cli took a regular expression that added a filter on a list. No objects in cache at the time of entry (that is: when purge() was run) that matches that regular expression would be served again - a new object would be fetched from the backend instead if requeted. - No memory was freed using purge(), excet using the 'ban lurker' (which was, confusingly, never called the "purge lurker"). - "nuke" was an internal Varnish term that could free a single object in cache. It was never exposed in CLI or VCL. In Varnish 3: - ban() from vcl AND cli takes regular expressions and is the same as purge() from Varnish 2.0. - No memory is freed using ban() in Varnish 3.0. - purge; is exposed to VCL: This is a way to expose the previously internal 'nuke' mechanism, and allows you to remove a single object and all its variants. It only works on a single object+variants, and does not take a regular expression. It acts immediately and has no lingering effect save that some memory is freed and an object is removed from cache. So yes, both ban() and purge; is available in Varnish 3. But what was known as purge() in Varnish 2 has been re-named, and purge; in Varnish 3 is something entirely different, more similar to setting obj.ttl and obj.grace to 0s for all variants of an object in vcl_hit. This name-mixing is unfortunate, but believed to be less confusing in the future when the ban()-vs-purge; terminology has had a chance to settle itself in our documentation, wiki and daily talk. The "PURGE" method (all caps) is usually used to reference a VCL implementation of the fictional http PURGE method, which is intended to do what purge; does in Varnish 3. In Varnish 2, it was usually implemented by setting ttl and grace to 0s in vcl_hit, which would not take care of all variants of an object. I hope this clears things up a bit. - Kristian _______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
