Welcome! Log In Create A New Profile

Advanced

Re: Cookie problem with proxy cache

Ole Laursen
November 18, 2009 03:48PM
Gabriel Ramuglia <gabe@...> writes:
> And then, of course, cookies will be sent even when trying to access
> things like images, css, js files, which will not be changing
> regardless of the cookie sent. So vary-cookie makes sense to me. I
> guess if I were caching software, I would just decide not to cache
> anything when it said vary-cookie, and would then ignore the cookies
> otherwise, and cache anyway, even if there were cookies. That seems to
> make the most sense to me.

Yes, exactly. The backend signals that a page depends on a cookie by sending a
Vary: cookie header. Nginx shouldn't cache and send such a page to everyone.


Here's the code in Varnish that handles the Vary header:

http://varnish.projects.linpro.no/browser/trunk/varnish-cache/bin/varnishd/cache_vary.c

I think it constructs a regexp used when looking for a matching object. So my
assertion about Varnish was wrong, it actually caches the page, but it only
returns it to a client with the same cookie. Full vary supports looks like it's
some work:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44

But I'd be happy with just support for Vary: cookie that simply bypasses the
cache. I had a brief look at the nginx code, but I'm not sure where one would do
the change?


Ole
Subject Author Posted

Cookie problem with proxy cache

Ole Laursen November 17, 2009 12:26AM

Re: Cookie problem with proxy cache

Emanuele Pucciarelli November 17, 2009 12:56PM

Re: Cookie problem with proxy cache

Jérôme Loyet November 17, 2009 01:18PM

Re: Cookie problem with proxy cache

Gabriel Ramuglia November 17, 2009 02:04PM

Re: Cookie problem with proxy cache

Ole Laursen November 18, 2009 03:48PM

Re: Cookie problem with proxy cache

Gabriel Ramuglia November 18, 2009 04:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready