Mailing List Archive

Varnish Caching based on Cookie
Hey Guys,

Simple question: Will varnish' cache increase in size when we add a
specific cookie to the hash? Or will varnish see that some pages
overlap in content and (eventually) evict duplicate pages from the page
cache?

I'm asking because we segment users into 20 segments by using a cookie,
but we don't want to increase our page cache 20-fold.

Thanks in advance!

- Thijs

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: Varnish Caching based on Cookie [ In reply to ]
On Fri, Nov 25, 2016 at 10:12 AM, Thijs Cramer <t.cramer@beslist.nl> wrote:
> I'm asking because we segment users into 20 segments by using a cookie,
> but we don't want to increase our page cache 20-fold.

Hello,

If you add a cookie to the hash, and this cookie can have 20 different
values, then you could end up with up to 20 differents objects in
cache. Varnish doesn't look into the content of the object and won't
"de-duplicate" objects or their content.

Also, beware of adding user data (cookie value, set by the client's
browser) into objects' hashes, as it could enable a client to saturate
the cache by filling it until exhaustion.

--
Thomas Lecomte / Sysadmin
+33 4 86 13 48 65 / Virtual Expo, Marseille

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc