Last active
February 5, 2016 18:19
-
-
Save rezan/d877af0dcbb16b35aeaf to your computer and use it in GitHub Desktop.
Varnish 4 grace
This file contains hidden or 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
# conditional grace for healthy/unhealthy (30s/1h) | |
vcl 4.0; | |
import std; | |
sub vcl_hit { | |
if (std.healthy(req.backend_hint) && obj.ttl + 30s < 0s) { | |
return(fetch); | |
} | |
} | |
sub vcl_backend_response { | |
set beresp.grace = 1h; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment