[Varnish] #907: Varnish alternates between 200 and 304 responses with ETags
Varnish
varnish-bugs at varnish-cache.org
Wed Apr 20 18:22:00 CEST 2011
#907: Varnish alternates between 200 and 304 responses with ETags
-------------------+--------------------------------------------------------
Reporter: lrowe | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 2.1.5 | Severity: normal
Keywords: |
-------------------+--------------------------------------------------------
I'm using Varnish 2.1.5 with a backend that produces ETags. This almost
works fine, except I see page loads alternating between 304 Not Modified
and 200 OK responses. This seems to be due to the 304 Not Modified
response inserting a Last-Modified header in the response. On the next
page load this causes the browser to send an If-Modified-Since header in
addition to the If-None-Match header. Varnish then responds with a 200 OK
rather then a 304 Not Modified.
VCL:
{{{
backend backend_0 { .host = "127.0.0.1"; .port = "8080"; }
}}}
When I add the following VCL to remove the If-Modified-Since header, I
always get a 304 Not Modified response:
{{{
sub vcl_recv {
if (req.http.If-None-Match) {
remove req.http.If-Modified-Since;
}
}
}}}
--
Ticket URL: <http://varnish-cache.org/trac/ticket/907>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list