Dirty Caching

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Apr 25 07:58:38 CEST 2008

In message <E0B3F838-D157-4949-8C03-667CA5A59CC0 at googlemail.com>, Paul Nasrat writes:
>On 23 Apr 2008, at 18:48, Max Clark wrote:
>> In July of 2007 there was a discussion on Dirty Caching - or serving
>> stale content if the backend is down:
>> http://projects.linpro.no/pipermail/varnish-misc/2007-July/000590.html
>> Whatever happened with this? Is this feature available with Varnish?
>> How do I configure it?

Well it happened, but ended up being called "grace mode" instead, since
that better describes what it does.

To enable:

	in vcl_recv:
		set req.grace = 2m;
	in vcl_fetch:
		set obj.grace = 2m;

Then if we encounter an expired object, but another client is already
busy pulling it from the backend, and it is not expired by more than
the lower of the two fields above, we serve the old object.

>Hopefully I should have a patch set shortly that allows set to contain  
>arithmetic operations with variables.

Sounds cool :-)

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list