-
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.
Implementing the Cache-Control "must-revalidate" directive
- Loading branch information
1 parent
6f7af3a
commit 3ea49a8
Showing
2 changed files
with
42 additions
and
0 deletions.
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,31 @@ | ||
varnishtest "Test must-revalidate" | ||
|
||
server s1 { | ||
rxreq | ||
txresp -hdr "Cache-Control: max-age=30" | ||
rxreq | ||
txresp -hdr "Cache-Control: max-age=30, must-revalidate" | ||
rxreq | ||
txresp -hdr "Cache-Control: max-age=30, must-revalidate, stale-while-revalidate=100" | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
sub vcl_backend_response { | ||
set beresp.http.grace = beresp.grace; | ||
set beresp.http.ttl = beresp.ttl; | ||
} | ||
} -start | ||
|
||
client c1 { | ||
txreq -url /1 | ||
rxresp | ||
expect resp.http.grace == 10.000 | ||
|
||
txreq -url /2 | ||
rxresp | ||
expect resp.http.grace == 0.000 | ||
|
||
txreq -url /3 | ||
rxresp | ||
expect resp.http.grace == 0.000 | ||
} -run |