<HTML>
<HEAD>
<TITLE>Re: varnish serve old object during refresh</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Yes I’m sure.<BR>
<BR>
The cached images are responding a lot faster and when I look into varnishlog I can see that it is being hit.<BR>
<BR>
Is it even possible to server old objects while retrieving new ones or is there always one visitor that is experiencing slow images?<BR>
<BR>
Thanks for your reply<BR>
<BR>
<BR>
On 2/7/12 2:27 PM, "AD" <<a href="straightflush@gmail.com">straightflush@gmail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>The VCL looks right at first glance. Are you sure the object is actually being cached in the first place? You can confirm with something like this in your vcl_deliver<BR>
<BR>
if (obj.hits > 0) {<BR>
set resp.http.X-Cache = "HIT";<BR>
} else {<BR>
set resp.http.X-Cache = "MISS";<BR>
}<BR>
<BR>
On Tue, Feb 7, 2012 at 2:48 AM, Jaap van Arragon <<a href="j.vanarragon@lukkien.com">j.vanarragon@lukkien.com</a>> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hello,<BR>
<BR>
Sorry for “kicking” my question but I really need help with this.<BR>
<BR>
How can I configure varnish 3 so that it will serve cached objects to the client while the new objects are being fetched from the backed?<BR>
<BR>
Hope to hear something.<BR>
<BR>
Thank you.<BR>
<BR>
Regards,<BR>
Jaap van Arragon<BR>
<BR>
<BR>
<BR>
On 1/30/12 3:23 PM, "Jaap van Arragon" <<a href="j.vanarragon@lukkien.com">j.vanarragon@lukkien.com</a> <<a href="http://j.vanarragon@lukkien.com">http://j.vanarragon@lukkien.com</a>> > wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><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>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
varnish-misc mailing list<BR>
<a href="varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a> <<a href="http://varnish-misc@varnish-cache.org">http://varnish-misc@varnish-cache.org</a>> <BR>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
_______________________________________________<BR>
varnish-misc mailing list<BR>
<a href="varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><BR>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>