caching of request with cookies

Harm Verhagen harm.verhagen at gmail.com
Thu Sep 23 10:59:40 CEST 2010


Hi,

I noticed that varnish out of the box doesn't cache requests that carry a
cookie.

This seems a bit too conservative to me.
According to the http specs the mere existence of a cookie should not
influence cachebility.  In the content of the response depends on the
cookie, the server should tell in the response that the contents are not
cacheble.
The Vary: Cookie header  exists for that reason, no ?

In the current default configuration if you put varnish in front of a
'well-behaving' (as in "adding all the required caching related http
headers")  website.  Most cacheble content does _not_ get cached. Unless you
do some non obvious (to me :) ) configuration of varnish.

What are the thoughts on this list about moving the default varnish
configuration closer to the http specification, regarding caching of request
where the client sends a cookie (and probably leading to problems on
websites that do _not_ use http headers correctly)

That said,
Does anyone has a pointer to a varnish configuration that does the thing I
described above.  I don't mean an example where vanish just strips off
cookies of  images/js/css files  request. (I found plenty examples of that
scenario) But leaving cookies as is, but just look at the responses to
decide if the content should be cached or not. So that varnish can
selectively cache html pages based on their response, where all requests
potentially have cookies).


Mvg,
Harm Verhagen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20100923/1cd77317/attachment-0003.html>


More information about the varnish-dev mailing list