I setup a simple rule in the my VCL to cache requests to a url, however, according to the X-Varnish header, the requests are not being cached. So I fired up varnishlog, and it confused me to see that it said there was a 'hit'.<div>
<br></div><div>Can someone explain why the object is not being returned as a cached object? I'm confused around the fact that it says there is a 'hit', but the X-Varnish header only has 1 field.</div><div><br>
</div><div>I read that if the Set-Cookie header is sent, then varnish does not cache the object, but I'm pretty sure thats not being sent. Is there another rule I'm missing? Thanks.</div><div><br></div><div>Here is an excerpt of the log:</div>
<div><br></div><div><div> 15 SessionOpen c 10.0.19.23 59326 :80</div><div> 15 ReqStart c 10.0.19.23 59326 1001168302</div><div> 15 RxRequest c GET</div><div> 15 RxURL c /items?xzy=true</div><div> 15 RxProtocol c HTTP/1.1</div>
<div> 15 RxHeader c Host: XYZ</div><div> 15 RxHeader c User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 GTB7.1</div><div> 15 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</div>
<div> 15 RxHeader c Accept-Language: en-us,en;q=0.5</div><div> 15 RxHeader c Accept-Encoding: gzip,deflate</div><div> 15 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7</div><div> 15 RxHeader c Keep-Alive: 115</div>
<div> 15 RxHeader c Connection: keep-alive</div><div> 15 RxHeader c Cookie: __qca=P0-707762352-1283409801091; __utma=182775871.333345873.1284063320.1293103561.1293171223.24; __utmz=182775871.1284063320.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); km_lv=x; km_ai=T7R0VpZshcfDBJiF4n8Edt1vrrI; km_uq=; __utmv=182775871.p</div>
<div> 15 RxHeader c If-None-Match: "4ee85970d12afd8992d3dc1651f07b9d"</div><div> 15 VCL_call c recv</div><div> 15 VCL_return c lookup</div><div> 15 VCL_call c hash</div><div> 15 VCL_return c hash</div>
<div> 15 Hit c 1001168004</div><div> 15 VCL_call c hit</div><div> 15 VCL_return c deliver</div><div> 15 VCL_call c deliver</div><div> 15 VCL_return c deliver</div><div> 15 TxProtocol c HTTP/1.1</div>
<div> 15 TxStatus c 304</div><div> 15 TxResponse c Not Modified</div><div> 15 TxHeader c Date: Tue, 28 Dec 2010 23:19:53 GMT</div><div> 15 TxHeader c Via: 1.1 varnish</div><div> 15 TxHeader c X-Varnish: 1001168302</div>
<div> 15 TxHeader c Cache-Control: private, max-age=0, must-revalidate</div><div> 15 TxHeader c ETag: "4ee85970d12afd8992d3dc1651f07b9d"</div><div> 15 TxHeader c Connection: keep-alive</div><div> 15 Length c 0</div>
<div> 15 ReqEnd c 1001168302 1293578393.040635109 1293578393.040782928 0.000112057 0.000097990 0.000049829</div><div> 15 Debug c "herding"</div></div>