<html><head></head><body bgcolor="#FFFFFF"><div>Your missing set beresp.ttl</div><div><br></div><div>Cheers</div><div><br></div><div>Nick Tailor<br><br>Sent from my iPhone</div><div><br>On Aug 1, 2012, at 9:25 AM, nicola sabbi <<a href="mailto:nsabbi@officinedigitali.it">nsabbi@officinedigitali.it</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>Hi,<div>I'm trying to configure varnish 3.0.1 as a failover cache in front of a web server running EZ publish. </div><div>What I'd like to do is to let varnish cache pages for up to 4 hours. If the backend server is seen sick it should serve the last cached page for the current request (if available), otherwise serve an error page.</div>
<div><br></div><div>The backend polling code is working fine, but every time I tamper with the test page returning a 404 error code (in order to force the sick mode) varnish returns a 503 error to the client instead of the cached content, even though the cache is populated (or so I assume).</div>
<div><br></div><div>The configuration code I'm using is the following:</div><div><br></div><div><br></div><div><div>backend default {</div><div> .host = "192.168.0.66";</div><div> .port = "80";</div>
<div> .probe = {</div><div> .url = "<a href="http://backend/test.php">http://backend/test.php</a>";</div><div> .timeout = 10s;</div><div> .interval = 5s;</div>
<div> .window = 3;</div><div> .threshold = 3;</div><div> .expected_response=200;</div><div> }</div><div>}</div><div><br></div><div>sub vcl_recv {</div><div> if (req.backend.healthy) {</div>
<div> set req.grace = 30m;</div><div> } else {</div><div> set req.grace = 4h;</div><div> }</div><div> #return(lookup);</div><div>}</div><div><br></div><div>sub vcl_fetch {</div><div> set beresp.grace = 8h;</div>
<div> # return(restart);</div><div>}</div><div><br></div><div><br></div><div><br></div><div>sub vcl_error {</div><div> set obj.http.Content-Type = "text/html; charset=utf-8";</div><div> set obj.http.Retry-After = "5";</div>
<div> synthetic {"</div></div><div>Unavailable page!</div><div><div>"};</div><div> return (deliver);</div><div>}</div></div><div><br></div><div>Please, can you explain me what's missing or wrong with this configuration?</div>
<div>Thanks,</div><div> Nico</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>varnish-misc mailing list</span><br><span><a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a></span><br><span><a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a></span></div></blockquote></body></html>