Conditional backend requests (ETag)

Magnus Hoff maghoff at gmail.com
Fri Sep 18 12:35:06 CEST 2015


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



More information about the varnish-misc mailing list