Using req/obj.grace to serve stale objects when backend fails

Jeff Anderson jeff at funnyordie.com
Fri Nov 7 03:05:46 CET 2008


I've experimented with req/obj.grace set to a few hours so a site can  
be served even if the backend fails.  For example, with the backend  
down and when req/obj.grace is set to several hours I can open a new  
browser and get a 503 if I try to open a known cached (and graced)  
page.  However if I refresh the same browser several times very  
rapidly I finally receive the graced page.  It seems to be working as  
expected from what I read in the documentation regarding the graced  
object being served while the same object is being fetched by another  
thread.  The rapid refreshing is generating a second thread request  
which then satisifies the requirements to have the graced object  
served.  Is there a way to configure varnish to serve the cached  
graced object if the backend fails without the browser ever seeing the  
503?  Can this also be tied into the backend probing/polling?

Thanks,
--J


More information about the varnish-misc mailing list