<HTML>
<HEAD>
<TITLE>varnish serve old object during refresh</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
How can I serve an old object during the fetch of an expired object or max out connection?<BR>
<BR>
I’ve configured the grace period in both the vcl_recv as the vcl_fetch.<BR>
<BR>
I even tried to use the saint mode to give me back an “old” cached object.<BR>
<BR>
Can somebody give me help in this matter?<BR>
<BR>
sub vcl_recv {<BR>
<BR>
# Purge through http<BR>
if (req.request == "PURGE") {<BR>
if (!client.ip ~ purge) {<BR>
error 405 "Not allowed.";<BR>
}<BR>
ban("req.url ~ " + req.url );<BR>
error 200 "Purged.";<BR>
}<BR>
<BR>
# Unset all cookies available<BR>
if (req.http.cookie) {<BR>
unset req.http.cookie;<BR>
}<BR>
<BR>
if (req.request != "GET" && req.request != "HEAD") {<BR>
/* We only deal with GET and HEAD by default */<BR>
return (pass);<BR>
}<BR>
<BR>
# Adding Grace period in case backend lags<BR>
set req.grace = 3d;<BR>
return (lookup);<BR>
}<BR>
....<BR>
sub vcl_fetch {<BR>
set beresp.grace = 4d;<BR>
set beresp.saintmode = 50s;<BR>
set beresp.ttl = 30s;<BR>
return (deliver);<BR>
}<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>