On Wed, Jul 5, 2017 at 10:04 AM, Quintin Par <[email protected]> wrote:
>
> Nginx has a nifty command for invalidating a specific cache
>
> proxy_cache_bypass $http_cachepurge;
>
> curl -I myapp.example.com/api/ping -H "cachepurge: true"
>
> Is there something equivalent in varnish?

Hi,

I'm not familiar with this nginx feature, but there is a hash_always_miss
feature in Varnish that allows you to bypass a cache hit.

You can probably do something like this in vcl_recv{}, I haven't tried:

    set req.hash_always_miss = req.http.cachepurge == "true";

However, this opens a DoS vector so you probably want to restrict this
using an ACL or other means.

Dridi

_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to