Mailing List Archive

again cookies problem...
Hello, list.

I'm so sorry for bothering you.
I have met serious problem related cookies.
my varnish is 1.1.1.

If I don't set like this at vcl, the web site which using cookies, loading
is too slow.

if (req.request == "GET" && req.http.cookie) {
lookup;
}

But, when I set like above, someone who visits the site, can see previous
connected person information.

So I changed like below,

if (req.request == "GET" && req.http.cookie && req.url ~
"\.(gif|jpg|swf|css|js)$") {
lookup;
}

After I set above, the problem which anyone can see others' information is
solved.
But this config makes the site a bit slow too.
I don't know why.

There are lots of sites which using cookies there, so I don't know how to
to.

So sorry for my unknowness. and please help me..


Thanks for your help in advance.

_________________________________________________________________
??? ???? ?? ??? MSN ?????!
http://match.kr.msn.com/channel/index.aspx?trackingid=1002127
again cookies problem... [ In reply to ]
"Monty Ree" <chulmin2 at hotmail.com> writes:
> If I don't set like this at vcl, the web site which using cookies,
> loading is too slow.

By default, Varnish bypasses the cache if the client sends a cookie or
the server sets one.

> if (req.request == "GET" && req.http.cookie) {
> lookup;
> }
>
> But, when I set like above, someone who visits the site, can see
> previous connected person information.

Precisely.

> So I changed like below,
>
> if (req.request == "GET" && req.http.cookie && req.url ~ "\.(gif|jpg|swf|css|js)$") {
> lookup;
> }

So images, stylesheets and JavaScript will be cached no matter what,
which is usually a good idea, but other documents will not be cached
if a cookie is involved.

> After I set above, the problem which anyone can see others'
> information is solved.

Precisely.

> But this config makes the site a bit slow too. I don't know why.

Because the cookies prevent Varnish from caching it. There isn't
really anything you can do about it unless you redesign your site to
not use cookies.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no