<div dir="ltr">Hi,<div><br></div><div>What do you mean by "work"? What's the expected result, and what is the actual result?</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Wed, Jun 29, 2016 at 8:17 AM, Andrei <span dir="ltr"><<a href="mailto:lagged@gmail.com" target="_blank">lagged@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm currently working on forcing cached results using vsthrottle vs dropping requests, but for some reason (I probably did it wrong :) I can't get var.get/var.set_duration to work. The vcl_recv snippet is as follows, any input is greatly appreciated:</div><div><br></div><div><div>sub vcl_recv {</div><div>        if (vsthrottle.is_denied(req.http.Host, 500, 5s) || (var.get("block-" + req.http.Host))) {<br></div><div>                # The vsthrottle rate limit definitely triggers - confirmed later with "Attack" header</div><div>                unset req.http.Cookie;</div><div>                unset req.http.User-Agent;</div><div>                unset req.http.Pragma;</div><div>                unset req.http.Cache-Control;</div><div>                set req.http.Attack = "ByHost: " + req.http.Host;</div><div>                set req.ttl = 15m;</div><div>                var.set_duration("block-" + req.http.Host,15m);</div><div>                return (hash);</div><div>        }</div><div>[..]<br></div><div>}</div></div></div>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br></div>