about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2015-11-21T20·20+0100
committerVincent Ambo <tazjin@gmail.com>2015-11-21T20·20+0100
commit6138a8b0f8bd57c8793e8cfd1ee0da5d76a472d6 (patch)
treef55c8a09e56768250ff75c4a8a2b13a6875b0d75
parent813c273e687d57e284aae8daec9ec7bd1196eecc (diff)
[varnish] Add X-Cache headers
-rw-r--r--varnish/default.vcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/varnish/default.vcl b/varnish/default.vcl
index a06bb744b725..5a15d21a9c98 100644
--- a/varnish/default.vcl
+++ b/varnish/default.vcl
@@ -41,6 +41,12 @@ sub vcl_backend_response {
 sub vcl_deliver {
         # Add an HSTS header to everything
         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 {