Any chance to support "max-stale" request header in Varnish?
michael.lee at zerustech.com
Wed Nov 30 08:32:02 CET 2016
I am working on a tutorial of HTTP/1.1 caching and I'd like to use
Varnish as the reverse proxy to demonstrate how HTTP/1.1 caching works.
However, I found there is no way to support the max-stale request header
The problem is that "a call to return(deliver)" always triggers a
backend fetch, explicitly, if the object's ttl has been exceeded, so
it's impossible to deliver a staled object for a single request.
The workaround might be shutting down the backend server to force a
failure of the backend fetch, thus to get the staled object delivered.
But besides that, is there any better solution to support the max-stale
In fact, the "max-stale" header is almost identical to "grace", except
that the "max-stale" header is controlled by the client, while the
"grace" is controlled by varnish. But still, unless we shut down the
backend server, there is no way to demonstrate the "grace" for single
Michael Lee / Managing Director / ZerusTech Ltd
Tel: +86 (21) 6107 3305
Mobile: +86 186 021 03818
Email: michael.lee at zerustech.com
Building No. 9, 4361 HuTai Road
More information about the varnish-misc