<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
I have noticed what seems to be a bug in varnish. If anyone has
experience with using ESI and timing things out from the cache
manually at the same time, please take a look at this and, if it is
not a bug, take a moment to explain what I am missing.<br>
<br>
I have ESI setup in varnish. I have a file 'a.ehtml' that includes
'b.html' via an ESI include. I have my hit function setup to do 'set
obj.ttl=0s' when a 'no-cache' request is sent in.
<div class="searchable">
<p>
If I make a request to b.html to reset it via 'no-cache' (
shift-refresh from my browser ), 'a.ehtml' still continues to be
cached for the original ttl of 'b.html' before I set it to 0.<br>
</p>
<p>That is:<br>
1. b.html contains '1'<br>
2. a.ehtml shows '1' in the browser ( it includes b )<br>
3. change the contents of b.html to '2'<br>
4. shift-refresh b.html to force it to update in the cache<br>
5. b.html now shows '2' in a browser<br>
6. a.ehtml continues to show '1' ( until time length of original
timeout of b.html passes )<br>
</p>
<p>
The relevant portion of vcl_hit:<br>
if( req.http.Cache-Control == "no-cache" ) {
</p>
<blockquote>
<p>
if (! (req.http.User-Agent ~ "bot|MSIE") ) {
</p>
<blockquote>
<p>
set obj.ttl = 0s;
return(restart);
</p>
</blockquote>
<p>
}<br>
}
</p>
</blockquote>
<blockquote>
</blockquote>
<p>
The revelant portion of vcl_fetch:
</p>
<table class="wiki">
<tbody>
<tr>
</tr>
</tbody>
</table>
<p>
if( req.url ~ "\.ehtml$" || beresp.http.Content-Type ==
"text/ehtml" ) {
</p>
<blockquote>
<p>
set beresp.http.Content-Type = "text/html";<br>
esi;
</p>
</blockquote>
<blockquote>
<p>
}
</p>
</blockquote>
</div>
<br>
<br>
<br>
</body>
</html>