Skip to content

Instantly share code, notes, and snippets.

@gquintard
Created March 18, 2016 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gquintard/3c39ce7bcd4b6a0ab9d0 to your computer and use it in GitHub Desktop.
Save gquintard/3c39ce7bcd4b6a0ab9d0 to your computer and use it in GitHub Desktop.
server s1 {
rxreq
expect req.url == "foo"
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_miss {
set req.http.state = "MISS";
}
sub vcl_hit {
set req.http.state = "HIT";
}
sub vcl_deliver {
set bereq.http.state = req.http.state;
}
} -start
client c1 {
txreq -url "/foo"
rxresp
expect req.http.state == "MISS"
txreq -url "/foo"
rxresp
expect req.http.state == "HIT"
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment