cookies

andan andan armdan20 at gmail.com
Mon Dec 13 17:08:31 CET 2010


2010/12/13 Stefan Pommerening <pom at dmsp.de>:
> Am 13.12.2010 09:46, schrieb andan andan:
>>
>> 2010/12/10 Vitaly Burshteyn<vburshteyn at broadway.com>:
>>>
>>> Hi folks,
>>>
>>> We use cookies to test if it's a returning visitor or not.  Is there any
>>> way to force a lookup on varnish if a specific cookie is present?
>>
>> http://www.varnish-cache.org/docs/2.1/reference/vcl.html
>>
>> Look at "..how to force Varnish to cache documents even when cookies
>> are present::"
>
> Just to point you in the right direction (although reading the reference
> documents _is_ necessary, too):
>
> in vcl_recv:
> (example)
> if (req.request == "GET" && req.http.cookie && req.http.cookie ~ "<regex>")
> {
>   [ normalize cookie for reasonable caching / reduce variations (lower
> number of objects in cache) ]

In the sake of good order, this piece of code doesn't affect the
number of objects in cache.

To vary the objects in cache in function of a cookie, you need to add
the cookie to the "req.hash" in the "hash" section.

Kind Regards.




More information about the varnish-misc mailing list