Determine if grace object is available
toasty at dragondata.com
Mon Jul 21 23:35:25 CEST 2014
Hi, Varnish people!
I’d like to get fancy with grace stored objects, but I’m not sure how to do this. Can I determine if there’s a grace object I could deliver? Basically I want my logic to be:
1) If the backend returns a 200, cache and deliver as normal.
2) If the backend returns anything other than a 200, and I have a stale object I could serve anyway, serve it.
3) If the backend returns anything other than a 200, restart to redirect to a final fallback.
I know how to do #1 and #3, but I’m not sure where/how I can do #2. Is there a way of determining if I could fallback to a stale object? If so, any pointers?
More information about the varnish-misc