-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSH: Limit the number of ban checks before vary matching
Refs: #4236
- Loading branch information
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
varnishtest "test ban + vary behavior" | ||
|
||
server s0 { | ||
rxreq | ||
txresp -hdr "vary: version" -body "Variant A" | ||
rxreq | ||
txresp -hdr "vary: version" -body "Variant B" | ||
rxreq | ||
txresp -hdr "vary: version" -body "New variant A" | ||
rxreq | ||
txresp -hdr "vary: version" -body "New variant B" | ||
} -start | ||
|
||
varnish v1 -arg "-p ban_variant_checks=0" -vcl+backend {} -start | ||
|
||
client c1 { | ||
txreq -hdr "version: a" | ||
rxresp | ||
expect resp.body == "Variant A" | ||
} -run | ||
|
||
client c2 { | ||
txreq -hdr "version: b" | ||
rxresp | ||
expect resp.body == "Variant B" | ||
} -run | ||
|
||
varnish v1 -cliok "ban req.http.version == a" | ||
|
||
# Should this remove a single variant from cache | ||
client c3 { | ||
txreq -hdr "version: a" | ||
rxresp | ||
expect resp.body == "New variant A" | ||
} -run | ||
|
||
client c4 { | ||
txreq -hdr "version: b" | ||
rxresp | ||
expect resp.body == "Variant B" | ||
} -run |