Skip to content

Instantly share code, notes, and snippets.

@aondio
Created November 15, 2021 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aondio/f3afbd1a66fcf043863cb74a385f76c4 to your computer and use it in GitHub Desktop.
Save aondio/f3afbd1a66fcf043863cb74a385f76c4 to your computer and use it in GitHub Desktop.
varnishtest "Check that Age header can be set to 0s"
server s1 {
rxreq
txresp
} -start
varnish v2 -vcl+backend {
sub vcl_deliver {
set resp.http.x-tier-mid = "mid";
}
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.http.Age = 0s;
}
sub vcl_deliver {
set resp.http.x-tier-edge = "edge";
}
} -start
client c1 -connect ${v1_sock} {
txreq
rxresp
expect resp.http.x-tier-edge == "edge"
expect resp.http.Age == 0
delay 1
txreq
rxresp
expect resp.http.x-tier-edge == "edge"
expect resp.http.Age > 0
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment