File tree 2 files changed +44
-0
lines changed 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ varnishtest "BF cache test by loading the same page twice"
2
+
3
+ server s1 {
4
+ # first request will be the probe, handle it and be on our way
5
+ rxreq
6
+ expect req.url == "/health_check.php"
7
+ txresp
8
+
9
+ # the probe expects the connection to close
10
+ close
11
+ accept
12
+
13
+ rxreq
14
+ expect req.url == "/"
15
+ expect req.method == "GET"
16
+ txresp
17
+
18
+ rxreq
19
+ expect req.url == "/"
20
+ expect req.method == "GET"
21
+ txresp
22
+ } -start
23
+
24
+ # Generate the VCL file based on included variables and write it to output.vcl
25
+ shell {
26
+ export s1_addr="${s1_addr}"
27
+ export s1_port="${s1_port}"
28
+ ${testdir}/helpers/parse_vcl.pl "${testdir}/../../etc/varnish6.vcl" "${tmpdir}/output.vcl"
29
+ }
30
+
31
+ varnish v1 -arg "-f" -arg "${tmpdir}/output.vcl" -arg "-p" -arg "vsl_mask=+Hash" -start
32
+
33
+ # make sure the probe request fired
34
+ delay 1
35
+
36
+ client c1 {
37
+ txreq -method "GET" -url "/"
38
+ rxresp
39
+
40
+ txreq -method "GET" -url "/"
41
+ rxresp
42
+ expect resp.http.Cache-Control == "must-revalidate, max-age=60"
43
+ } -run
Original file line number Diff line number Diff line change 14
14
' GRACE_PERIOD' => ' 300' ,
15
15
' SSL_OFFLOADED_HEADER' => ' X-Forwarded-Proto' ,
16
16
' USE_XKEY_VMOD' => ' 1' ,
17
+ ' ENABLE_BFCACHE' => ' 1' ,
17
18
' ENABLE_MEDIA_CACHE' => ' 1' ,
18
19
' ENABLE_STATIC_CACHE' => ' 1' ,
19
20
' ACCESS_LIST' => ' server1 server2' ,
You can’t perform that action at this time.
0 commit comments