[varnish] Add X-Cache headers
This commit is contained in:
parent
813c273e68
commit
6138a8b0f8
1 changed files with 6 additions and 0 deletions
|
@ -41,6 +41,12 @@ sub vcl_backend_response {
|
||||||
sub vcl_deliver {
|
sub vcl_deliver {
|
||||||
# Add an HSTS header to everything
|
# Add an HSTS header to everything
|
||||||
set resp.http.Strict-Transport-Security = "max-age=31536000;includeSubdomains;preload";
|
set resp.http.Strict-Transport-Security = "max-age=31536000;includeSubdomains;preload";
|
||||||
|
|
||||||
|
if (obj.hits > 0) {
|
||||||
|
set resp.http.X-Cache = "HIT";
|
||||||
|
} else {
|
||||||
|
set resp.http.X-Cache = "MISS";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub vcl_synth {
|
sub vcl_synth {
|
||||||
|
|
Loading…
Reference in a new issue