Skip to content

Instantly share code, notes, and snippets.

@nkallen
Created November 13, 2008 23:08
Show Gist options
  • Save nkallen/24677 to your computer and use it in GitHub Desktop.
Save nkallen/24677 to your computer and use it in GitHub Desktop.
test "Stale objects are expired, but served from cache for a grace period"
shell "/Users/pivotal/workspace/freshyfresh/bin/memset version:test 2"
server s {
rxreq
expect req.url == "/"
txresp -status 200 -hdr "ETag: 1" -hdr "X-Generation-Key: version:test"
} -start
varnish v -vcl+backend {
include "/usr/local/etc/varnish/default.vcl";
} -start
client c1 {
txreq -req GET -url "/"
rxresp
expect resp.http.ETag == "1"
} -run
server s {
rxreq
txresp -status 200 -hdr "ETag: 2" -hdr "X-Generation-Key: version:test" -hdr "Connection: close"
} -start
client c2 {
txreq -req GET -url "/"
rxresp
expect resp.http.ETag == "2"
} -start
client c3 {
txreq -req GET -url "/"
rxresp
# expect resp.http.ETag == "1"
} -start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment