Commit bfffd7e4 authored by Nils Goroll's avatar Nils Goroll

more polishing of the real world vcl code

- minimum ttl of 10s for HFM objects
- simplify the X-TTL code
- show is_esi() example
parent 60a3e730
......@@ -124,6 +124,9 @@ varnish v1 \
unset beresp.http.X-TTL;
} else {
set beresp.uncacheable = true;
if (beresp.ttl < 10s) {
set beresp.ttl = 10s;
}
}
return (deliver);
}
......@@ -143,16 +146,14 @@ varnish v1 \
}
sub br_deliver {
unset resp.http.X-TTL;
# for ESI:
# if (objesi.is_esi() || obj.uncacheable)
if (obj.uncacheable) {
# NOP
} else if (local.socket == "self_plain") {
if (obj.uncacheable) {
unset resp.http.X-TTL;
} else {
set resp.http.X-TTL = obj.ttl;
}
set resp.http.X-TTL = obj.ttl;
} else {
unset resp.http.X-TTL;
if (resp.http.Vary ~ "\bV-A-E\s*,") {
set resp.http.Vary = regsub(resp.http.Vary,
"\bV-A-E\s*,\s*", "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment