Conditional backend requests (ETag)

Magnus Hoff maghoff at gmail.com
Fri Sep 18 15:13:55 CEST 2015


Thanks for getting back to me.

I went back and tried poking around some more. It seems like when I
set the TTL to zero it seems to disable the conditional request
functionality as well. Anyway, when I set the TTL to 1s instead, it
seems to be working well, with however long keep-times I give it.

Thanks :)


-m

On Fri, Sep 18, 2015 at 12:57 PM, Guillaume Quintard
<guillaume at varnish-software.com> wrote:
> Hi Magnus,
>
> The documention you are looking for is here :
> https://www.varnish-cache.org/docs/4.0/reference/vcl.html
>
> And beresp.keep is definitely what you are looking for. If ttl is expired
> but not ttl + keep, varnish will issue a conditionnal request.
>
> --
> Guillaume Quintard
>
> On Fri, Sep 18, 2015 at 12:35 PM, Magnus Hoff <maghoff at gmail.com> wrote:
>>
>> Hi :)
>>
>> What is the status of support for conditional backend requests?
>>
>> My use case is accelerating CouchDB, which has good support for ETags,
>> but offers no other caching opportunities.
>>
>> I have found [1] which leads me to think that the branch implementing
>> this feature was merged to trunk in 2011. According to [2] (which also
>> says, in big bold letters, "This documentation is out of date"), I
>> should be able to see this working with the default VCL: "In the
>> default case (i.e. if not superseded by something in VCL), a
>> conditional request is generated during fetch with If-Modified-Since
>> and/or If-None-Match headers whose values are taken from stale_obj's
>> Last-Modified and/or ETag headers."
>>
>> [1]:
>> https://www.varnish-cache.org/lists/pipermail/varnish-commit/2011-July/006720.html
>> [2]: https://www.varnish-cache.org/trac/wiki/BackendConditionalRequests
>>
>> However, when testing with the latest Varnish from the Varnish Ubuntu
>> repository (https://www.varnish-cache.org/installation/ubuntu),
>> "varnish-4.0.3 revision b8c4a34", I am unable to trigger conditional
>> backend requests in the default configuration. I have feebly tried
>> making the VCL more explicit in that it should try to keep the ETagged
>> versions around by setting beresp.keep explicitly, but I can't seem to
>> effect a change in behavior.
>>
>> So, what is happening? Does Varnish currently support what I am
>> looking for? What is the up to date documentation on this? Is there
>> support for this on a branch still? How is that branch coming along?
>>
>>
>> Thank you :)
>> - Magnus Hoff
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc at varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>



More information about the varnish-misc mailing list