Skip to content

Commit

Permalink
Merge branch '1.13' into 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Jan 16, 2019
2 parents b6a397b + 54b467b commit c3185e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions doc/varnish/vcl/varnish4_xkey.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ sub vcl_deliver {
}
}


if (client.ip ~ debuggers) {
# In Varnish 4 the obj.hits counter behaviour has changed, so we use a
# different method: if X-Varnish contains only 1 id, we have a miss, if it
# contains more (and therefore a space), we have a hit.
if (resp.http.x-varnish ~ " ") {
// Add X-Cache header if debugging is enabled
if (obj.hits > 0) {
set resp.http.X-Cache = "HIT";
set resp.http.X-Cache-Hits = obj.hits;
set resp.http.X-Cache-TTL = obj.ttl;
// Not readable on Varnish 4.1LTS, so check for existence until we drop support for it in future versions
if (obj.ttl) {
set resp.http.X-Cache-TTL = obj.ttl;
}
} else {
set resp.http.X-Cache = "MISS";
}
Expand Down

0 comments on commit c3185e5

Please sign in to comment.