Caching pages with URL parameters

pub crawler pubcrawler.com at gmail.com
Sun Jan 10 13:05:36 CET 2010


I managed to perfect the caching of our pages spitting out cookies
through trial and error.

So this page for instance now caches in Varnish even though the
cookies come along with the page:
http://www.pubcrawler.com/Template/dsp_restaurant_zoom.cfm/flat/ID=415517/muma%20restaurant

Accomplished this it appears by adding to vcl_fetch:
 if (obj.http.Set-Cookie) {
     lookup;
 }

In our webserver we added the headers:
Cache-Control "public; max-age=600"
Vary "Accept-Encoding"

We now get this underlying output:
HTTP/1.1 200 OK
Keep-Alive: timeout=15
Set-Cookie: CFID=12188767;expires=Tue, 03-Jan-2040 12:02:39 GMT;path=/
Set-Cookie: CFTOKEN=2af59da685f8a0a1-181D504B-B9C8-47B9-5FFC50F14FAF2D99;expires=Tue,
03-Jan-2040 12:02:39 GMT;path=/
Set-Cookie: CFGLOBALS=urltoken%3DCFID%23%3D12188767%26CFTOKEN%23%3D2af59da685f8a0a1%2D181D504B%2DB9C8%2D47B9%2D5FFC50F14FAF2D99%23lastvisit%3D%7Bts%20%272010%2D01%2D10%2007%3A02%3A39%27%7D%23timecreated%3D%7Bts%20%272010%2D01%2D10%2007%3A02%3A39%27%7D%23hitcount%3D2%23cftoken%3D2af59da685f8a0a1%2D181D504B%2DB9C8%2D47B9%2D5FFC50F14FAF2D99%23cfid%3D12188767%23;expires=Tue,
03-Jan-2040 12:02:39 GMT;path=/
Set-Cookie: CFGLOBALS=urltoken%3DCFID%23%3D12188767%26CFTOKEN%23%3D2af59da685f8a0a1%2D181D504B%2DB9C8%2D47B9%2D5FFC50F14FAF2D99%23lastvisit%3D%7Bts%20%272010%2D01%2D10%2007%3A02%3A39%27%7D%23timecreated%3D%7Bts%20%272010%2D01%2D10%2007%3A02%3A39%27%7D%23hitcount%3D2%23cftoken%3D2af59da685f8a0a1%2D181D504B%2DB9C8%2D47B9%2D5FFC50F14FAF2D99%23cfid%3D12188767%23;expires=Tue,
03-Jan-2040 12:02:39 GMT;path=/
Content-Type: text/html; charset=UTF-8
Content-Length: 245747
Date: Sun, 10 Jan 2010 12:02:48 GMT
X-Varnish: 1341696448 1341696422
Age: 9
Via: 1.1 varnish
Connection: keep-alive


Unsure if there is potential here for someone to pickup another user's
session since cookies going out to someone other than the person who
originally loaded the page.  Potential exists, but haven't seen it yet
here.

How can I get Varnish to strip those Cookies before it puts it into the cache?

Thanks!



More information about the varnish-misc mailing list