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

Anders Nordby anders at
Wed Nov 12 21:19:48 CET 2008


On Thu, Nov 06, 2008 at 06:05:46PM -0800, Jeff Anderson wrote:
> 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?

It's not possible yet, but wanted. See ticket You may also have an
interest for



More information about the varnish-misc mailing list