Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save section-io-gists/4bf93cbddf5a2da09a9b to your computer and use it in GitHub Desktop.
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
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