[Varnish] #1485: Background refetches update the text of the HTTP status line
Varnish
varnish-bugs at varnish-cache.org
Wed Apr 23 15:08:29 CEST 2014
#1485: Background refetches update the text of the HTTP status line
---------------------------------+----------------------
Reporter: smerrill | Type: defect
Status: new | Priority: low
Milestone: Varnish 4.0 release | Component: varnishd
Version: 4.0.0 | Severity: minor
Keywords: |
---------------------------------+----------------------
Varnish 4 is an excellent release - thank you for everything.
I have noticed one interesting issue. This example uses background
refresh, and the simplified VCL is as follows, setting a short TTL for
HTML pages but a long grace/keep interval to allow conditional background
refreshes.
{{{
sub vcl_backend_response {
if (beresp.http.Content-Type ~ "text/html" && beresp.ttl > 0s) {
set beresp.ttl = 1m;
}
set beresp.grace = 24h;
set beresp.keep = 24h;
}
}}}
This works extremely well, but after the backend sends a 304 in response
to Varnish's conditional backend request, the text of the status line is
updated to be "HTTP/1.1 200 Not Modified".
{{{
$ curl -I -XGET -s http://192.168.168.168/ | egrep '(HTTP|Age)'
HTTP/1.1 200 OK
Age: 0
# Wait about two minutes, hit it again.
$ curl -I -XGET -s http://192.168.168.168/ | egrep '(HTTP|Age)'
HTTP/1.1 200 OK
Age: 132
# Background conditional request is now triggered, hit it one more time.
$ curl -I -XGET -s http://192.168.168.168/ | egrep '(HTTP|Age)'
HTTP/1.1 200 Not Modified
Age: 5
}}}
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1485>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list