Skip to content

Instantly share code, notes, and snippets.

@rezan
Created August 11, 2017 14:49
Show Gist options
  • Save rezan/2dbfc726468a9742e5478b57be362d07 to your computer and use it in GitHub Desktop.
Save rezan/2dbfc726468a9742e5478b57be362d07 to your computer and use it in GitHub Desktop.
Setting grace from the backend
varnishtest "Setting grace from the backend"
server s1 {
rxreq
txresp -hdr "Cache-Control: max-age=60, stale-while-revalidate=15"
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.http.X-ttl = beresp.ttl;
set beresp.http.X-grace = beresp.grace;
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.http.X-ttl == "60.000"
expect resp.http.X-grace == "15.000"
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment