Cache'ing request despite PASS

Krzysztof Dajka alteriks at gmail.com
Mon May 23 23:16:33 CEST 2011


>From my observations, grace only works when object is already cached
in varnish, it doesn't work unless object has been HIT. In case when
all backends are sick grace just keeps object in memory even if
expires/ttl has ran out. Object is STALE for amount of time set in
grace.

I'm already using grace for static objects on my websites, but I'd
like to cache htmls which currently are passed to cms backends. I'd
like to serve stale objects only in case of disaster in my cms. Has
anyone created acl based for example on googlebot IP addresses and
cache htmls which are crawled by bots and serve them only in case
whole cms director went down? I think it sounds nice but I haven't
tried that yet.

2011/5/23 Laurence Rowe <l at lrowe.co.uk>:
> On 23 May 2011 16:18, Krzysztof Dajka <alteriks at gmail.com> wrote:
>> Hi,
>> I'd like to know whether somebody tried to write a vcl that would
>> serve always fresh object from backend (for example PASSed) but
>> despite this request would be stripped from cookies and cached. This
>> cached object would be only served if whole director went sick. Is
>> this possible to write such vcl or it would require changes in varnish
>> code?
>>
>> If this idea is insane, I'd be happy to hear somebody shouting 'it's
>> totally crazy!' ;)
>
> I believe this is one of the problems that req.grace solves. See
> http://www.varnish-cache.org/trac/wiki/VCLExampleGrace
>
> Laurence
>




More information about the varnish-misc mailing list