Hello,<br>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:<br>
<br> 10 RxHeader c If-Modified-Since: Mon, 08 Dec 2008 17:28:41 GMT<br> 10 RxHeader c Cache-Control: max-age=0<br> 10 VCL_call c recv<br> 10 VCL_return c lookup<br> 10 VCL_call c hash<br> 10 VCL_return c hash<br>
10 Hit c 1043648757<br> 10 VCL_call c hit<br> 10 VCL_return c deliver<br> <b> 10 Length c 0</b><br> 10 VCL_call c deliver<br> 10 VCL_return c deliver<br> 10 TxProtocol c HTTP/1.1<br>
10 TxStatus c 304<br> 10 TxResponse c Not Modified<br> 10 TxHeader c Date: Wed, 21 Jan 2009 15:16:20 GMT<br> 10 TxHeader c Via: 1.1 varnish<br> 10 TxHeader c X-Varnish: 1043648775<br> 10 TxHeader c Last-Modified: Mon, 08 Dec 2008 17:28:41 GMT<br>
<br clear="all">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 Shift-Refresh).<br><br>I'm reading this as saying:<br>
<br>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.<br>2. vcl_recv decides to do a lookup.<br>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.<br>
4. vcl_deliver decides to send a 304 not modified instead of the actual response.<br><br>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?<br>
<br>-- <br>Nathan<a href="mailto:nathan.lenz@gmail.com" target="_blank"></a><br>