PURGE Regardless of Vary/Hash

Dridi Boukelmoune dridi.boukelmoune at zenika.com
Tue Jan 13 20:15:32 CET 2015


On Tue, Jan 13, 2015 at 8:01 PM, Thomas Lecomte
<thomas.lecomte at virtual-expo.com> wrote:
> If I am wrong, I would love to be corrected because I had the very
> same issue and had to went with bans instead :-)

As a matter of fact, a purge happens for all variants behind a hash.

The default hash is computed from the host header (fallback to the
interface ip) and the url. Unless you do funky stuff in vcl_recv, it
should be a no brainer. My rule of thumb is to treat PURGE requests
like GET requests (include any modification that may happen on cache
keys before the lookup).

Don't forget to purge on a cache miss, just in case there's a variant
sitting in your cache.

For ban vs purge, you need to ask yourselves more questions, like
whether you'd need to keep a stale object in case of a backend
failure.

Dridi



More information about the varnish-misc mailing list