<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:664742129;
mso-list-template-ids:-1103622022;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
</head>
<body lang=DE link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I have requested one page with different browsers
(firefox, chrome). If I make a second request with the same browser I get the
object from the varnish cache. But if the first browser makes the first request
and the second browser makes the second one I get a miss.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>In my configuration the hash will be determined only
by the url and host header (nothing else). Client side Cache-Control or Pragma
headers were totally ignored. Here a snippet out of my vcl config:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>sub vcl_recv {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> unset
req.http.Pragma;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> unset
req.http.Cache-Control;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> …<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>sub vcl_hash {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> set req.hash += req.url;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> if (req.url == "/") {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> set
req.hash += req.http.host;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'> return (hash);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>sub vcl_deliver {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
if (obj.hits > 0) {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
set resp.http.X-Cache = "HIT";<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
} else {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
set resp.http.X-Cache = "MISS";<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>
unset resp.http.X-Varnish;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Here the 2 browser requests:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;font-weight:bold'>Request 1 by
Firefox:<o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Host: XXXXX<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1;
en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Accept-Language: en-us,en;q=0.5<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Accept-Encoding: gzip,deflate<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Keep-Alive: 115<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Connection: keep-alive<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Referer: XXXXX<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Cookie: __utma=31143592.1898076621.1291293810.1291291810.1291291810.1;
__utmb=31173592; __utmc=31543592;
__utmz=31143592.1291291810.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none);
__utma=61459198.633465754.1291291861.1291241861.1291291861.1; __utmb=6145912.2.10.1291291861;
__utmc=61459198; __utmz=61459198.1291881861.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;font-weight:bold'>Response 1 (Request
made by Firefox)<o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Server: nginx<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Date: Thu, 02 Dec 2010 12:11:26 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Content-Type: text/html; Charset=utf-8<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Connection: keep-alive<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Keep-Alive: timeout=20<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Cache-Control: public, max-age=600<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Expires: Thu, 02 Dec 2010 12:21:26 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Last-Modified: Thu, 02 Dec 2010 12:11:26 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>CacheInfo: 600<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Content-Encoding: gzip<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>X-Cache: MISS
// that’s ok, cause the object wasn’t cached before<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Content-Length: 7978<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Age: 0<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=2 face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;font-weight:bold'>Request 2 by Chrome<o:p></o:p></span></font></b></p>
<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Accept: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:0cm;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>User-Agent: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Mozilla/5.0
(Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko)
Chrome/7.0.517.44 Safari/534.7<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:0cm;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:0cm;vertical-align:top'><b><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial;font-weight:bold'>Response
2 by Chrome<o:p></o:p></span></font></b></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:0cm;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Age: </span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>0<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Cache-Control: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>public,
maxage=600<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>CacheInfo: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>600<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Connection: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>keep-alive<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:0cm;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Content-Encoding: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>gzip<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Content-Length: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>8004<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Content-Type: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>text/html;
Charset=utf-8<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Date: </span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thu, 02 Dec 2010
12:11:56 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Expires: </span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thu, 02 Dec 2010
12:21:56 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Keep-Alive: </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>timeout=20<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Last-Modified: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Thu,
02 Dec 2010 12:11:56 GMT<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Server: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>nginx<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>X-Cache: </span></font><font
size=2 face=Arial><span lang=EN-GB style='font-size:10.0pt;font-family:Arial'>MISS
// That’s not ok, cause the request was done 30 sec after the
first one ant the max-age is 600<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>The nginx is only
proxying the request to varnish and handles gzip. The object will be cached
(can see it in varnishlog).<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Can you help me with my
problem?<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Thanks<o:p></o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='mso-margin-top-alt:.75pt;margin-right:0cm;margin-bottom:
.75pt;margin-left:-.75pt;vertical-align:top'><font size=2 face=Arial><span
lang=EN-GB style='font-size:10.0pt;font-family:Arial'>Martin<o:p></o:p></span></font></p>
</div>
</body>
</html>