<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: Caching issue</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Fair enough..here you go:<BR>
<BR>
I used Firefox and IE from the same machine:<BR>
<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>
<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>
<BR>
And here is the current vcl.conf:<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>
# Do a "lookup" in the cache. This goes to "vcl_hit", or to<BR>
# "vcl_miss" and then "vcl_fetch"<BR>
lookup;<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>
if (obj.ttl < 3600s) {<BR>
set obj.ttl = 3600s;<BR>
}<BR>
insert;<BR>
}<BR>
<BR>
sub vcl_hash {<BR>
<BR>
set req.hash += req.url;<BR>
hash;<BR>
}<BR>
<BR>
<BR>
Thanks,<BR>
<BR>
Shain<BR>
<BR>
-----Original Message-----<BR>
From: Dag-Erling Smørgrav [<A HREF="mailto:des@linpro.no">mailto:des@linpro.no</A>]<BR>
Sent: Sat 3/8/2008 10:58 AM<BR>
To: Shain Miley<BR>
Cc: Adrian Otto; varnish-dev@projects.linpro.no<BR>
Subject: Re: Caching issue<BR>
<BR>
Shain Miley <smiley@npr.org> writes:<BR>
> Thanks for the info...here is the output from my request (ip's<BR>
> changed)..in case this can shed some light on things:<BR>
<BR>
This is useless if you don't also show us a request that worked.<BR>
<BR>
DES<BR>
--<BR>
Dag-Erling Smørgrav<BR>
Senior Software Developer<BR>
Linpro AS - www.linpro.no<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>