Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save section-io-gists/a93af63a9e2d350bdb6962a974eba5f5 to your computer and use it in GitHub Desktop.
Save section-io-gists/a93af63a9e2d350bdb6962a974eba5f5 to your computer and use it in GitHub Desktop.
# You must set a grace period on any object you put in cache for this to work.
sub vcl_hit {
if (obj.ttl >= 0s) {
return (deliver);
}
if (obj.ttl + obj.grace > 0s) {
return (deliver);
}
# This must return fetch if Varnish version 4/5. This is config for Varnish 6
return (miss);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment