Created
June 27, 2018 14:50
-
-
Save timbirk/1fe37567dd331bb887b4c28754b0f222 to your computer and use it in GitHub Desktop.
Simple VCL Puppet template with caching
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
# This file is managed by Puppet. Manual changes will be destroyed. | |
# A naively simple config to cache items for <%= @cache_ttl %> and serve stale objects | |
# for up to <%= @grace_ttl %> on backend outage (data reload) | |
vcl 4.0; | |
# Default backend definition. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "<%= @proxy_port %>"; | |
.connect_timeout = 2s; | |
.first_byte_timeout = 30s; | |
.probe = { | |
.url = "/"; | |
.timeout = 15s; | |
.interval = 30s; | |
.window = 5; | |
.threshold = 3; | |
} | |
} | |
sub vcl_backend_response { | |
set beresp.grace = <%= @grace_ttl %>; | |
set beresp.ttl = <%= @cache_ttl %>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment