Skip to content

Instantly share code, notes, and snippets.

@rezan
Created September 21, 2020 16:47
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 rezan/8b2960540ddaca369db7ee8ce0fdbb69 to your computer and use it in GitHub Desktop.
Save rezan/8b2960540ddaca369db7ee8ce0fdbb69 to your computer and use it in GitHub Desktop.
req.body and restarts
varnishtest "req.body and restarts"
server s1 -repeat 4 {
rxreq
txresp -bodylen 1000
} -start
varnish v1 -vcl+backend {
import std;
sub vcl_recv {
std.cache_req_body(1MB);
if (!req.restarts) {
return (pass);
}
return (hash);
}
sub vcl_backend_response {
set beresp.ttl = 0.1s;
}
sub vcl_deliver {
if (!req.restarts) {
return (restart);
}
}
} -start
client c1 {
txreq -req PUT -bodylen 2500
rxresp
expect resp.status == 200
delay 0.2
txreq -req PUT -bodylen 2500
rxresp
expect resp.status == 200
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment