Strange different behavior

Poul-Henning Kamp phk at
Fri Jan 15 16:17:54 CET 2010

In message <4B508643.6020501 at>, Rob S writes:

>> I belive so, but the result will probably be that it varies on all your
>> cookies...
>In the 2010 road map, with the ability to extract particular cookies, do 
>you reckon we could do anything to make this work?  So, we'd set a 
>cookie called "RenderType", and then Varnish would key on that cookie 
>value?  In the short term, can we set the hash to be a combination of a 
>cookie value and host and URL?

Well, there are two mechanisms available:  Vary and vcl_hash.

Vary: is the RFC2616 sanctioned way, and some backends understand how
to use it.  It is not cookie-cognizant.

vcl_hash:  This is Varnish forte:  You get to decide what you consider
the identifying properties of an "object", and you could, add any
property you want, a cookie, client.ip, req.http.authentication etc.

The VCL syntax for accessing cookies is getting closer, among other
things it depends on being able to dynamically allocate space in the
session for HTTP headers (please test this in -trunk :-)


Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-misc mailing list