[squid-users] Squid is not aware of logged and anonymous users

From: Daniel Gomez <dgabad_at_gmail.com>
Date: Tue, 22 Jun 2010 19:18:18 +0200

Good afternoon everyone,

I´m using Squid in front of Zope/Plone. Since my main pages
(Homepage,...) are quite static I would want to cach them for Anoymous
users, but not for logged users. I am using the policies:

- Anonymous: Cache in proxy for 24 hours (tested with ETag header and without)
- Logged user: Cache in the browser with ETag

So what happens is, when a user visits a main page as anoymous it gets
the page from Squid, since already other anonymous users have visited
them before. For example the obtained ETag for the page is:

Etag ||Anonymous|318239|Plone Default|en|en-gb|.......

Then the user logs into Plone but keeps seeing the same page as
anoymous. The ETag from the requested Page is the same as anonymous.

If the user refresh the browser a "Cache-Control max-age=0" is sent in
the Request-Header and then the user can see the page as logged. The
ETag changes to:

Etag |userid|Authenticated;Contributor;Editor;Manager;Member|318239|Plone
Default|en|en-gb|.......

Thinking about the cookies I´ve checked if they sent when a request is
performed, and they are. After logging, when a different page is
requested, the new cookie is also sent in the header but the request
NEVER reaches Plone, the page is gived by Squid.

Cookie LOCALIZER_LANGUAGE="en"; __ac="fRskMyzSPHK1YzQZ/+sTA5/775kgZ29tZXo="

What I deduce is that Squid is saving the pages with a cache key (URL
+ ETag), and it is not able to know if the user that requests the page
is Logged or Anonymous, since no information is saved in the cache key
of Squid about that.

* Happens the same without using ETag on the Anonymous Policy"

Anyone has an idea about how to solve this? May be adding some
additional information like the cookie value on the ETag?

Thanks,

Daniel G.A.
Received on Tue Jun 22 2010 - 17:18:26 MDT

This archive was generated by hypermail 2.2.0 : Wed Jun 23 2010 - 12:00:04 MDT