tl;dr; when using Varnish 4 and bans via varnishadm, instead of “ban.url EXPRESSION”, use “ban req.url ~ EXPRESSION”.
In Varnish 3.0 we had the ban.url command in the varnishadm CLI. This was a shortcut function expanding to the a bit cryptic (but powerful) ban command. In essence ban.url just took your expression, prefixed it with “req.url ~ ” and fed it to ban. No magic.
We deprecated this in Varnish 4.0, and now everyone has to update their CMS’s plugin for cache invalidation. Hence this blog post. Perhaps it will help. Perhaps not. :-)
Some references:
- https://www.varnish-cache.org/docs/trunk/users-guide/purging.html#bans – the proper docs on ban. Note the part about lurker friendliness.
- https://www.varnish-cache.org/lists/pipermail/varnish-dev/2012-November/007399.html – the discussion on the mailing list on removing it.
Pingback: Varnish Cache Migrate from Version 3 to 4 | Listek Consulting | Listek Consulting