Closed
Description
The Varnish documentation in the cookbook isn't 100% correct. In order to purge you need to make sure the PURGE method is dealt with in vcl_recv, otherwise Varnish is going to fallback on default behaviour.
This means Varnish will consider it a non-RFC-compliant method, will pipe the request to the backend and ignore the Varnish caching mechanisms.
To avoid that simply catch PURGE requests and immediately perform a lookup to the cache. By doing this you'll skip default behaviour.
It's just a matter of adding the following piece of VCL
sub vcl_recv {
if (req.request == "PURGE") {
return(lookup);
}
}
A full example of an acl would also be interesting.
I'm going to create a pull request and link to this issue as a reference.