serving from cache

Laurence Rowe l at lrowe.co.uk
Wed Jun 2 21:26:14 CEST 2010


If you know cookies do not affect the backend, you can just customise
``vcl_recv`` to ``return (lookup)`` when you have a cookie.
http://varnish-cache.org/browser/branches/2.1/varnish-cache/bin/varnishd/default.vcl#L63

If a page always sets the same cookie value, you can cache the
response with the Set-Cookie header (or strip it as you see fit) by
customising ``vcl_fetch`` to ``return (deliver)``. Obviously that's
not suitable for session cookies.

Laurence

On 2 June 2010 14:24, vitaly burshteyn <vburshteyn at gmail.com> wrote:
>
> Hi folks,
> So on my path to getting the website to server from cache instead of the
> back end i realized that i had a cookie issue (sorry i am new to Varnish)
> Cookie: affi=old; __ngt_cli=C8D6A206C800FDA28F4A7F07;
> __utma=32297913.1583573073.1275401467.1275478692.1275481795.6;
> So i changed my vcl_recv to strip out all the utma and other google
> analytics cookies.
> Yet for some reason no matter what i try i cant get it to strip  affi=old;
> So i just want to confirm that untill this is empty:
> Set-Cookie: affi=old; Path=/^@^[^@^V^@^@^@
> I wont be able to server from cache?
>
>
> Thanks
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> http://lists.varnish-cache.org/mailman/listinfo/varnish-misc
>



More information about the varnish-misc mailing list