Skip to content

Instantly share code, notes, and snippets.

@rezan
Created Jul 6, 2020
Embed
What would you like to do?
varnishscoreboard parallel ESI
varnishtest "varnishscoreboard parallel ESI"
barrier b1 cond 3
barrier b2 cond 3
server s1 {
rxreq
txresp -body {
<esi:include src="/c1"/>
<esi:include src="/c2"/>
}
expect req.url == "/parent"
rxreq
expect req.url == "/c1"
barrier b1 sync
barrier b2 sync
txresp -body s1
} -start
server s2 {
rxreq
expect req.url == "/c2"
barrier b1 sync
barrier b2 sync
txresp -body s2
} -start
varnish v1 -cliok "param.set thread_pool_track on" -vcl+backend {
sub vcl_backend_fetch {
if (bereq.url == "/c2") {
set bereq.backend = s2;
}
}
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
client c1 {
txreq -url /parent -hdr "Host: esi"
rxresp
expect resp.body ~ s1
expect resp.body ~ s2
} -start
barrier b1 sync
shell -match "GET esi /c1" {
varnishscoreboard -n ${v1_name}
}
shell -match "GET esi /c2" {
varnishscoreboard -n ${v1_name}
}
shell -match "GET esi /parent" {
varnishscoreboard -n ${v1_name}
}
barrier b2 sync
client c1 -wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment