Cache-control: no-cache

Kristian Lyngstol kristian at varnish-software.com
Tue Dec 14 09:04:54 CET 2010


On Mon, Dec 13, 2010 at 11:55:16AM -0500, Jacob Elder wrote:
> The default Varnish config does not honor "no-cache" in Cache-control
> headers. It is my personal opinion that it should, but it's easy enough to
> add this behavior if desired.

This is a trade-off of sorts. RFC2616 doesn't really have any real
description of a reverse proxy, and thus we are left making best efforts.
In most cases, we find ourself on the origin-side of the equation.

The Cache-Control header is currently sent to the clients too and it is
with those in mind that most web application developers design the
Cache-Control header. Even using s-maxage/max-age is controversial enough.

The difference is that s-maxage/max-age/expire require date-parsing, which
isn't trivial in VCL at the moment. Check if no-cache or private is present
is trivial.

Personally, I'm leaning towards keeping the curent behavior, but it's a
topic of frequent debate. It's very common to distinguish between
web-clients and the reverse proxy - ideally we'd want our own set of
headers...

- Kristian



More information about the varnish-misc mailing list