<div dir="ltr"><img width="0" height="0" class="mailtrack-img" style="float:right;" alt="" src="https://mailtrack.io/trace/mail/339c2f4e1be5e75029325314eebcf07d8f8dcda0.png?u=74734"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;color:rgb(0,0,0)">
















<p class="gmail-MsoNoSpacing">Does hash_always_miss invalidate the cache? <span></span></p>

</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">- Quintin</div></div>
<br><div class="gmail_quote">On Wed, Jul 5, 2017 at 1:21 AM, Dridi Boukelmoune <span dir="ltr"><<a href="mailto:dridi@varni.sh" target="_blank">dridi@varni.sh</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Jul 5, 2017 at 10:04 AM, Quintin Par <<a href="mailto:quintinpar@gmail.com">quintinpar@gmail.com</a>> wrote:<br>
><br>
> Nginx has a nifty command for invalidating a specific cache<br>
><br>
> proxy_cache_bypass $http_cachepurge;<br>
><br>
> curl -I <a href="https://mailtrack.io/trace/link/034cd6cb88d2124e6aa40aa6bf29bd014db03eb8?url=http%3A%2F%2Fmyapp.example.com%2Fapi%2Fping&userId=74734&signature=64a0a6061bf36017" rel="noreferrer" target="_blank">myapp.example.com/api/ping</a> -H "cachepurge: true"<br>
><br>
> Is there something equivalent in varnish?<br>
<br>
</span>Hi,<br>
<br>
I'm not familiar with this nginx feature, but there is a hash_always_miss<br>
feature in Varnish that allows you to bypass a cache hit.<br>
<br>
You can probably do something like this in vcl_recv{}, I haven't tried:<br>
<br>
    set req.hash_always_miss = req.http.cachepurge == "true";<br>
<br>
However, this opens a DoS vector so you probably want to restrict this<br>
using an ACL or other means.<br>
<br>
Dridi<br>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://mailtrack.io/trace/link/f72e9c877fe9a482b98f0606a6b12e974cf3ebef?url=https%3A%2F%2Fwww.varnish-cache.org%2Flists%2Fmailman%2Flistinfo%2Fvarnish-misc&userId=74734&signature=db96c78a1ed9472f" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
</blockquote></div><br></div>