From dd46e79c15d74f18533459dcaf564e22644dd52e Mon Sep 17 00:00:00 2001 From: tfheen Date: Wed, 28 Jan 2009 12:22:58 +0000 Subject: [PATCH] Merge r3402: Document grace Thanks to perbu for suggested documentation Fixes 355 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/branches/2.0@3554 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/man/vcl.7so | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/varnish-cache/man/vcl.7so b/varnish-cache/man/vcl.7so index 84ff8a10..03c2acb3 100644 --- a/varnish-cache/man/vcl.7so +++ b/varnish-cache/man/vcl.7so @@ -186,6 +186,24 @@ if (client.ip ~ local) { pipe; } .Ed +.Ss Grace +If the backend takes a long time to generate an object there is a risk +of a thread pile up. +In order to prevent this you can enable grace. +This allows varnish to serve an expired version of the object while a +fresh object is being generated by the backend. +.Pp +The following vcl code will make Varnish serve expired objects. +All object will be kept up to two minutes past their expiration time +or a fresh object is generated. +.Bd -literal -offset 4n +sub vcl_recv { + set req.grace = 2m; +} +sub vcl_fetch { + set obj.grace = 2m; +} +.Ed .Ss Functions The following built-in functions are available: .Bl -tag -width indent -- 2.39.5