<br><br><div class="gmail_quote">On Tue, Sep 1, 2009 at 4:58 AM, Poul-Henning Kamp <span dir="ltr"><<a href="mailto:phk@phk.freebsd.dk">phk@phk.freebsd.dk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class="im"><br>
<br>
</div>503's are never cached to my knowledge.<br>
<br>
the rest can be obtained by:<br>
<br>
sub vcl_fetch {<br>
if (beresp.status != 200 && beresp.status != 404) {<br>
set beresp.ttl = 0;<br>
return (pass);<br>
}<br>
}<br>
<font color="#888888"><br>
</font></blockquote></div><br><br>So my setup is a bit different, since I'm one of those that want to server stuff pass the grace period, if my backends are down. I also want to protect myself against a self inflicted DoS due to errors. So ideally, saint mode is what i'd like ( ie, dont store this unless you are a better result )<br>
<br>here's the pertinent configs...<br><br>sub vcl_recv {<br> ....<br> # even though an object may be expired, we want to serve it up for this long to prevent thread pile up<br> # we also want to be somewhat aggresive if the backend is up(healthy)<br>
if (req.backend.healthy) {<br> set req.grace = 5m;<br> } else {<br> set req.grace = 600m;<br> }<br>...<br>}<br><br>sub vcl_fetch {<br> # here, we cache for more time codes that are not server errors<br>
if ( obj.status <500) {<br> set obj.grace = 600m;<br> set obj.ttl = 600s;<br> set obj.cacheable = true;<br> } else {<br> set obj.grace = 5s;<br>
set obj.ttl = 60s;<br> set obj.cacheable = true;<br> }<br><br>}<br><br><br><br>Before, i use to just have a blanket vcl_fetch setting my grace and ttl, which is probably the reason why i was caching the 500's<br>
<br><br><br>-Javier<br><br><br>