Varnish caches objects per session for ?

Michael Lee michael.lee at
Fri Dec 21 12:14:33 CET 2007

Hi Guys,

I noticed a possible issue on today, I guess the varnish cache on this site was configured to cache objects per user session. Which means, cached objects can't be re-used across different users.

I tried the following test cases:

1. clean up cookies and temporary internet files from my browser (I'm using Mandriva linux 2007 and Firefox

2. Access

3. Check the http response header and got a "HTTP/1.x 200 OK" response. (cache miss)

4. Reload page and got a "HTTP/1.x 304 Not Modified
" response. (cache hit)

Does it mean that the first time when I accessed, the cache was missed? So varnish re-fetched the contents for me. And the 2nd time, cache was hit. 

I know that specifying "cookie" as part of the object hash in vcl_hash() may force varnish to cache objects per user session. But is using the same approach? Besides, does it make sense to cache objects per user session for

Is there anyone can help investigate?

Many thanks in advance,


Michael Lee / Managing Director / ZerusTech Ltd

Tel: +86 (21) 6428 3803
Fax: +86 (21) 6428 3805
Mobile: +86 139 1663 5259
Skype: zerustech
Gmail: zerustech at

Suite 819-820
807 Zhaojiabang Road

More information about the varnish-commit mailing list