<!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">
<font size="+1">Hi,<br>
<br>
I have a problem with Varnish 2.1.4 stripping the Cache-Control
header, which results in the client caching pages, that are not
supposed to be cached (or to be more precise - locally storing
them, allowing the back button to be served without a hit to the
server).<br>
<br>
The header looks like this (should be standard PHP session
Cache-control).<br>
<br>
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0<br>
<br>
I'm running FreeBSD, and this problem has been verified with the
default.vcl.<br>
<br>
Steps:<br>
<br>
1. Restart varnishd<br>
2. Hit the page - this time the Cache-Control header will be
served to the client<br>
3. Hit the page again - this time the Cache-Control header will be
stripped by varnish. From now on it will be stripped.<br>
<br>
varnishlog -b still reports:<br>
...<br>
10 RxHeader b Set-Cookie:
PHPSESSID=ba69a435445f9d1b617951cb2ef00d35; path=/<br>
10 RxHeader b Expires: Thu, 19 Nov 1981 08:52:00 GMT<br>
10 RxHeader b Cache-Control: no-store, no-cache,
must-revalidate, post-check=0, pre-check=0<br>
10 RxHeader b Pragma: no-cache<br>
...<br>
<br>
But varnishlog -c reports:<br>
...<br>
9 TxHeader c Set-Cookie:
PHPSESSID=1bf083ca11d321412cce8155e593fe86; path=/<br>
9 TxHeader c Expires: Thu, 19 Nov 1981 08:52:00 GMT<br>
9 TxHeader c Pragma: no-cache<br>
...<br>
<br>
The result is not cached in varnish due to the Cookie - which is
exactly as it should be.<br>
<br>
First time after the restart varnishlog -c reports <br>
...<br>
9 VCL_call c recv<br>
9 VCL_return c lookup<br>
9 VCL_call c hash<br>
9 VCL_return c hash<br>
9 VCL_call c miss<br>
9 VCL_return c fetch<br>
9 Backend c 10 default default<br>
9 TTL c 1643766043 RFC 0 1291814342 1291814342
375007920 0 0<br>
9 VCL_call c fetch<br>
9 VCL_return c pass<br>
...<br>
9 VCL_call c deliver<br>
9 VCL_return c deliver<br>
...<br>
<br>
But after the first requests it reports:<br>
...<br>
9 VCL_call c recv<br>
9 VCL_return c lookup<br>
9 VCL_call c hash<br>
9 VCL_return c hash<br>
9 HitPass c 1643766043<br>
9 VCL_call c pass<br>
9 VCL_return c pass<br>
...<br>
9 VCL_call c fetch<br>
9 VCL_return c pass<br>
...<br>
9 VCL_call c deliver<br>
9 VCL_return c deliver<br>
...<br>
<br>
So its cached as a pass - fine, but this is where I dont
understand whats happening. It fetches the page corrently from the
server, and then removed the Cache-Control header. <br>
<br>
Why?<br>
<br>
This was not a problem in the past - I think it was version 2.1.2
or 2.1.3 when it worked, so I have a feeling that this might be a
bug.<br>
<br>
Best regards<br>
Lars<br>
<br>
</font>
</body>
</html>