This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Cut off ESI request should be retried" | |
server s1 { | |
rxreq | |
expect req.url == "/list" | |
txresp -body {<esi:include src="/fragment"/>} | |
rxreq | |
expect req.url == "/fragment" | |
txresp -status 503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
sub vcl_recv { | |
if (!std.healthy(req.backend_hint)) { | |
set req.grace = 4h; | |
} | |
sub vcl_backend_response { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "implementing x-accel-redirect" | |
server s1 { | |
rxreq | |
expect req.url == "/s1" | |
txresp -hdr "X-Accel-Redirect: /s2" | |
rxreq | |
expect req.url == "/s2" | |
txresp | |
} -start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VCP layer: | |
v_b_r: | |
# Simply use caching headers. Nothing relevant here. | |
if beresp.http.X-VCP-Ttl > 0: | |
beresp.ttl = beresp.http.X-VCP-Ttl | |
beresp.grace = beresp.http.X-VCP-Grace | |
beresp.keep = beresp.http.X-VCP-Keep | |
else: | |
# Let built-in VCL transform this in a HFM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Get YKeys from Origin server" | |
server s1 { | |
rxreq | |
txresp -hdr "ykey: BOB TOM" | |
} -start | |
varnish v1 -vcl+backend { | |
import ykey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Test HTTP vmod CUSTOM request" | |
server s1 { | |
rxreq | |
txresp -status 601 | |
} -start | |
server s2 { | |
rxreq | |
txresp -status 602 -reason "PURGE ok" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Goto and fallbacks" | |
server s1 { | |
rxreq | |
txresp -hdr "backend:s1" | |
expect req.url == "/client" | |
rxreq | |
txresp -status 404 -hdr "backend:s1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "Conditional Edgestash test" | |
server s1 { | |
rxreq | |
txresp -hdr "Etag: \"100\"" -hdr "bstatus: 200" -hdr "Content-Type: json" -body "Hello, {{first}} {{last}}!" | |
expect req.url == "/page.es" | |
rxreq | |
txresp -hdr "Etag: \"200\"" -body { | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
varnishtest "shard director by req.url (default)" | |
server s1 { | |
rxreq | |
expect req.url == "/s1" | |
expect req.http.Host == "host1" | |
txresp -status 404 -hdr "Server: s1" -body "server1" | |
} -start | |
server s2 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mse.conf: | |
========= | |
env: { | |
id = "my_mse_id"; | |
memcache_size = "auto"; | |
books = ( { | |
id = "small"; |