How do you confirm cookies are removed from static files?

Chris Altman caltman at
Wed Sep 29 18:04:08 CEST 2010

I am new to Varnish and have read the documentation. My goal is to remove all cookies from static files. 

My VCL is:

sub vcl_recv {
  if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
    unset req.http.cookie;

sub vcl_fetch {
  if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
    unset beresp.http.set-cookie;

I am confused because it appears the static files are served from Varnish but still have a cookie in their Request Headers. How do I remove the Request Headers cookie? Am I still gaining the benefits of Varnish if the Request Headers cookies exist?

Thank you,
Chris Altman

Response Headersview source
Server	Apache/2.2.14 (Ubuntu)
X-Powered-By	PHP/5.3.2-1ubuntu4.5
Expires	Thu, 29 Sep 2011 15:56:42 GMT
Vary	Accept-Encoding
Last-Modified	Thu, 24 Jun 2010 21:16:50 GMT
Cache-Control	max-age=31536000, public
Content-Encoding	gzip
Content-Type	text/css; charset=utf-8
Content-Length	3339
Date	Wed, 29 Sep 2010 15:56:42 GMT
X-Varnish	2062520895
Age	0
Via	1.1 varnish
Connection	keep-alive

Request Headersview source
User-Agent	Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20100914 Firefox/3.6.10
Accept	text/css,*/*;q=0.1
Accept-Language	en-us,en;q=0.5
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
Cookie	perq=20; __utma=90567579.1481902958.1285699566.1285768162.1285775102.4; __utmz=90567579.1285699566.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); perqworks=c7jcfkdueap5ggtbds500al703; __utmb=90567579.4.10.1285775102; __utmc=90567579

(404) 961-2065 office
(404) 849-0870 mobile

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list