Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
213a251e
Commit
213a251e
authored
Mar 09, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A hash_always_miss can override a hit-for-pass
With a more assertive test this time.
parent
06f9176f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
c00082.vtc
bin/varnishtest/tests/c00082.vtc
+28
-0
No files found.
bin/varnishtest/tests/c00082.vtc
View file @
213a251e
...
...
@@ -2,9 +2,15 @@ varnishtest "hash_always_miss overrides hit-for-pass"
server s1 {
rxreq
expect req.http.Uncacheable == false
txresp -hdr "Hit-Pass: forever"
rxreq
expect req.http.Uncacheable == true
txresp
rxreq
expect req.http.Uncacheable == false
txresp
} -start
...
...
@@ -13,6 +19,10 @@ varnish v1 -vcl+backend {
set req.hash_always_miss = (req.http.Hash == "always-miss");
}
sub vcl_backend_fetch {
set bereq.http.Uncacheable = bereq.uncacheable;
}
sub vcl_backend_response {
if (beresp.http.Hit-Pass == "forever") {
return (pass(1y));
...
...
@@ -24,11 +34,27 @@ varnish v1 -vcl+backend {
}
} -start
logexpect l1 -v v1 -g request {
expect * 1001 VCL_return lookup
expect * 1001 VCL_call MISS
expect * 1002 TTL "^HFP 31536000 "
expect * 1003 VCL_return lookup
expect * 1003 VCL_call PASS
expect * 1005 VCL_return lookup
expect * 1005 VCL_call MISS
expect * 1007 VCL_return lookup
expect * 1007 VCL_call HIT
} -start
client c1 {
txreq
rxresp
expect resp.http.Obj-Hits == 0
txreq
rxresp
expect resp.http.Obj-Hits == 0
txreq -hdr "Hash: always-miss"
rxresp
expect resp.http.Obj-Hits == 0
...
...
@@ -37,3 +63,5 @@ client c1 {
rxresp
expect resp.http.Obj-Hits == 1
} -run
logexpect l1 -wait
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment