<HTML dir=ltr><HEAD><TITLE>Re: Caching issue</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText85866 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>The output from below is a result of 'varnishlog > log.file'.  According to the man page if I don't use '-b' or '-c' both are assumed..so I don't know why any of the logging would be missing? Am I missing somthing?</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>In terms of the '<FONT face="Times New Roman">different Accept-Encoding header ' being set by the other browser..do you mean the 'Vary' header?  The reason I ask is because both set Accept-Encoding to 'gzip:deflate' so they are the same there.  If it is the result of 'Vary' can I simply remove that header and achive what I am looking for?</FONT></FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I would also like to know if anyone knows how I can better debug the hash that is being created...ie...I would like you know exaclty what information is being used in it's creation, so I can get to a plcae really where only the url is being used as the hash...that way it will match on any machine, from any browser, as long as the url has been cached.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I know that the vcl.conf file that I provided has a lot of redundant info in it...but I was trying to make sure it does a lookup and insert no matter what and I wanted to be sure that no case would be missed...cause it is still not working for me.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Thanks again for taking time to help me,</FONT></DIV>
<DIV dir=ltr><FONT size=2><BR>Shain</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Dag-Erling Smørgrav [mailto:des@linpro.no]<BR><B>Sent:</B> Sun 3/9/2008 5:49 AM<BR><B>To:</B> Shain Miley<BR><B>Cc:</B> Adrian Otto; varnish-dev@projects.linpro.no<BR><B>Subject:</B> Re: Caching issue<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>"Shain Miley" <SMiley@npr.org> writes:<BR>> First the cache hit:<BR>><BR>>    12 SessionOpen  c 172.1.1.1 3203<BR>>    12 ReqStart     c 172.1.1.1 3203 42332617<BR>>    12 RxRequest    c GET<BR>>    12 RxURL        c /templates/topics/topic.php?topicId=1006<BR>>    12 RxProtocol   c HTTP/1.1<BR>>    12 RxHeader     c Host: server11.npr.org:8080<BR>>    12 RxHeader     c User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12<BR>>    12 RxHeader     c Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=$<BR>>    12 RxHeader     c Accept-Language: en-us,en;q=0.5<BR>>    12 RxHeader     c Accept-Encoding: gzip,deflate<BR>>    12 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<BR>>    12 RxHeader     c Keep-Alive: 300<BR>>    12 RxHeader     c Connection: keep-alive<BR>>    12 RxHeader     c Cookie: v1st=7ED84E9096FDA5B; GUID=0003D141E48D07D140F1C40561626364<BR>>    12 RxHeader     c If-None-Match: "jpd--899294354.37421"<BR>>    12 VCL_call     c recv<BR>>    12 VCL_return   c lookup<BR>>    12 VCL_call     c hash<BR>>    12 VCL_return   c hash<BR>>    12 Hit          c 42332555<BR>>    12 VCL_call     c hit<BR>>    12 VCL_return   c deliver<BR>>    12 Length       c 9137<BR>>    12 VCL_call     c deliver<BR>>    12 VCL_return   c deliver<BR>>    12 TxProtocol   c HTTP/1.1<BR>>    12 TxStatus     c 200<BR>>    12 TxResponse   c OK<BR>>    12 TxHeader     c Server: Apache<BR>>    12 TxHeader     c X-Powered-By: PHP/5.2.3<BR>>    12 TxHeader     c X-Cache: jpcache vv2 - npr-burn<BR>>    12 TxHeader     c ETag: "jpd--899294354.37421"<BR>>    12 TxHeader     c Cache-Control: max-age=0<BR>>    12 TxHeader     c Expires: Sat, 08 Mar 2008 22:41:22 GMT<BR>>    12 TxHeader     c Vary: Accept-Encoding<BR>>    12 TxHeader     c Content-Encoding: gzip<BR>>    12 TxHeader     c Content-Encoding: gzip<BR>>    12 TxHeader     c Content-Type: text/html<BR>>    12 TxHeader     c Content-Length: 9137<BR>>    12 TxHeader     c Date: Sat, 08 Mar 2008 22:43:05 GMT<BR>>    12 TxHeader     c X-Varnish: 42332617 42332555<BR>>    12 TxHeader     c Age: 102<BR>>    12 TxHeader     c Via: 1.1 varnish<BR>>    12 TxHeader     c Connection: keep-alive<BR>>    12 ReqEnd       c 42332617 1205016185.289316893 1205016185.289417028 0.006116867 0.000038147 0.000061989<BR><BR>Where is the backend traffic?  Please use both -b and -c.<BR><BR>> Now the cache miss:<BR>><BR>>    12 SessionOpen  c 172.1.1.1 3211<BR>>    12 ReqStart     c 172.1.1.1 3211 42332632<BR>>    12 RxRequest    c GET<BR>>    12 RxURL        c /templates/topics/topic.php?topicId=1006<BR>>    12 RxProtocol   c HTTP/1.1<BR>>    12 RxHeader     c Accept: */*<BR>>    12 RxHeader     c Accept-Language: en-us<BR>>    12 RxHeader     c Accept-Encoding: gzip, deflate<BR>>    12 RxHeader     c User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)<BR>>    12 RxHeader     c Host: server11.npr.org:8080<BR>>    12 RxHeader     c Connection: Keep-Alive<BR>>    12 RxHeader     c Cookie: v1st=2E524136463554A; GUID=000748BD59C807AC295102B561626364; LE4=+5SoM6V421+314+4<BR>>    12 VCL_call     c recv<BR>>    12 VCL_return   c lookup<BR>>    12 VCL_call     c hash<BR>>    12 VCL_return   c hash<BR>>    12 VCL_call     c miss<BR>>    12 VCL_return   c fetch<BR>>    12 Length       c 455<BR>>    12 VCL_call     c deliver<BR>>    12 VCL_return   c deliver<BR>>    12 TxProtocol   c HTTP/1.1<BR>>    12 TxStatus     c 503<BR>>    12 TxResponse   c Service Unavailable<BR>>    12 TxHeader     c Server: Varnish<BR>>    12 TxHeader     c Retry-After: 30<BR>>    12 TxHeader     c Content-Type: text/html; charset=utf-8<BR>>    12 TxHeader     c Content-Length: 455<BR>>    12 TxHeader     c Date: Sat, 08 Mar 2008 22:43:15 GMT<BR>>    12 TxHeader     c X-Varnish: 42332632<BR>>    12 TxHeader     c Age: 0<BR>>    12 TxHeader     c Via: 1.1 varnish<BR>>    12 TxHeader     c Connection: keep-alive<BR>>    12 ReqEnd       c 42332632 1205016194.493165016 1205016195.508080959 0.005739927 1.014875889 0.000040054<BR><BR>This client sent a different Accept-Encoding header than the first one,<BR>so from Varnish's perspective, these two requests are actually for two<BR>different objects.<BR><BR>> And here is the current vcl.conf:<BR><BR>Is it the same vcl.conf that was in effect when the above requests were<BR>logged?<BR><BR>> #<BR>> # This is a basic VCL configuration file for varnish.  See the vcl(7)<BR>> # man page for details on VCL syntax and semantics.<BR>> #<BR>> # $Id: default.vcl 1929 2007-08-29 15:37:59Z des $<BR>> #<BR>><BR>> # Default backend definition.  Set this to point to your content<BR>> # server.<BR>><BR>> backend default {<BR>> set backend.host = "172.31.2.61"; // use your own backend ip address<BR>> set backend.port = "80"; // use your own backend port<BR>> }<BR>><BR>> sub vcl_recv {<BR>><BR>>   # Remove the "Cookie:" header from the request.<BR>>   remove req.http.Set-Cookie;<BR>>   remove req.http.Cache-Control;<BR>><BR>><BR>> if (req.request == "GET" && req.url ~ "\.(html|php|gif|jpg|swf|css|js|png|jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|css|js|vsd|doc)$") {<BR>>             lookup;<BR>>         }<BR>><BR>> if (req.http.Cache-Control ~ "no-cache") {<BR>>        lookup;<BR>> }<BR>> if (req.http.Cache-Control == "max-age=0") {<BR>>        lookup;<BR>> }<BR><BR>This is useless, because a) you've already removed that header and b)<BR>Varnish doesn't obey it anyway.<BR><BR>>   # Do a "lookup" in the cache.  This goes to "vcl_hit", or to<BR>>   # "vcl_miss" and then "vcl_fetch"<BR>>   lookup;<BR><BR>If you're going to do a lookup anyway, why bother with all of the above?<BR><BR>This will break badly with POST, btw.<BR><BR>> }<BR>><BR>> # Do the PURGE thing<BR>> sub vcl_hit {<BR>> }<BR>> sub vcl_miss {<BR>> }<BR>><BR>> sub vcl_fetch {<BR>> if (obj.ttl < 7200s) {<BR>> set obj.ttl = 7200s;<BR>>         }<BR>> insert;<BR>><BR>>  if (obj.http.Pragma ~ "no-cache" || obj.http.Cache-Control ~ "no-cache" || obj.http.Cache-Control ~ "max-age=0") {<BR>>         insert;<BR>>         }<BR><BR>This is useless because a) the "insert" above terminates vcl_fetch and<BR>b) Varnish does not obey Pragma or Cache-Control anyway.<BR><BR>><BR>>   if (obj.ttl < 3600s) {<BR>>     set obj.ttl = 3600s;<BR>>   }<BR>> insert;<BR><BR>Redundant.<BR><BR>> }<BR>><BR>> sub vcl_hash {<BR>><BR>> set req.hash += req.url;<BR>> hash;<BR>> }<BR><BR>Why not host?  Why define vcl_hash at all?  The default should suffice.<BR><BR>DES<BR>--<BR>Dag-Erling Smørgrav<BR>Senior Software Developer<BR>Linpro AS - www.linpro.no<BR><BR></FONT></P></DIV></BODY></HTML>