Am I reading the varnishlog correctly?

Nathan Lenz store+varnish at
Wed Jan 21 16:58:54 CET 2009

I have a weird case of Varnish returning a hit with a Length of 0.  It
happens when I clear my browser cache and then hit refresh.  Varnish returns
a 304 status and my browser shows a blank white page.  Here is a snippet of
the varnishlog output:

   10 RxHeader     c If-Modified-Since: Mon, 08 Dec 2008 17:28:41 GMT
   10 RxHeader     c Cache-Control: max-age=0
   10 VCL_call     c recv
   10 VCL_return   c lookup
   10 VCL_call     c hash
   10 VCL_return   c hash
   10 Hit          c 1043648757
   10 VCL_call     c hit
   10 VCL_return   c deliver
  * 10 Length       c 0*
   10 VCL_call     c deliver
   10 VCL_return   c deliver
   10 TxProtocol   c HTTP/1.1
   10 TxStatus     c 304
   10 TxResponse   c Not Modified
   10 TxHeader     c Date: Wed, 21 Jan 2009 15:16:20 GMT
   10 TxHeader     c Via: 1.1 varnish
   10 TxHeader     c X-Varnish: 1043648775
   10 TxHeader     c Last-Modified: Mon, 08 Dec 2008 17:28:41 GMT

My default.vcl is pretty much the default, with a few minor changes that I
copied from the wiki.  (Normalizing Accept-Encoding and allowing purge on

I'm reading this as saying:

1. Browser asks varnish for a new copy, with a max age of 0 from Mon, 08 Dec
2008 17:28:41 GMT or newer.
2. vcl_recv decides to do a lookup.
3. It's found that the item exists in the cache (hit!) but that the file
hasn't been modified since Mon, 08 Dec 2008 17:28:41 GMT.
4. vcl_deliver decides to send a 304 not modified instead of the actual

I wonder why my browser is sending an If-Modified-Since header when it
doesn't really have a copy?  I've been running Varnish on a heavily used
testing server for the past week and I get this from time to time in both
Firefox and Safari but I can't reproduce it consistently.  Anyone experience
anything like this?

Nathan <nathan.lenz at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list