Last active
March 5, 2022 14:29
-
-
Save section-io-gists/4bf93cbddf5a2da09a9b to your computer and use it in GitHub Desktop.
Varnish 4.0: Add HTTP response headers to indicate cache hit/miss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_deliver { | |
if (obj.hits > 0) { | |
set resp.http.X-Cache = "HIT"; | |
} else { | |
set resp.http.X-Cache = "MISS"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment