@@ -16,15 +16,15 @@ to your Varnish configuration. This ACL determines which IPs are allowed to
16
16
issue invalidation requests. Let’s call the ACL `invalidators `. The ACL below
17
17
will be used throughout the Varnish examples on this page.
18
18
19
- .. code-block :: c
19
+ .. code-block :: varnish4
20
20
21
21
# /etc/varnish/your_varnish.vcl
22
22
23
23
acl invalidators {
24
- "localhost";
25
- # Add any other IP addresses that your application runs on and that you
26
- # want to allow invalidation requests from. For instance:
27
- # "192.168.1.0"/24;
24
+ "localhost";
25
+ # Add any other IP addresses that your application runs on and that you
26
+ # want to allow invalidation requests from. For instance:
27
+ # "192.168.1.0"/24;
28
28
}
29
29
30
30
.. important ::
@@ -42,14 +42,14 @@ Purge removes a specific URL (including query strings) in all its variants (as s
42
42
43
43
.. configuration-block ::
44
44
45
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/purge.vcl
46
- :language: varnish3
47
- :linenos:
48
-
49
45
.. literalinclude :: ../tests/Functional/Fixtures/varnish-4/purge.vcl
50
46
:language: varnish4
51
47
:linenos:
52
48
49
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/purge.vcl
50
+ :language: varnish3
51
+ :linenos:
52
+
53
53
Refresh
54
54
~~~~~~~
55
55
@@ -69,13 +69,13 @@ To configure Varnish for `handling BAN requests <https://www.varnish-software.co
69
69
70
70
.. configuration-block ::
71
71
72
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-3 /ban.vcl
73
- :language: varnish3
72
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-4 /ban.vcl
73
+ :language: varnish4
74
74
:lines: 1-7, 15-18, 20-
75
75
:linenos:
76
76
77
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-4 /ban.vcl
78
- :language: varnish4
77
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-3 /ban.vcl
78
+ :language: varnish3
79
79
:lines: 1-7, 15-18, 20-
80
80
:linenos:
81
81
@@ -97,13 +97,13 @@ Add the following to your Varnish configuration to enable :ref:`cache tagging <t
97
97
98
98
.. configuration-block ::
99
99
100
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-3 /ban.vcl
101
- :language: varnish3
100
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-4 /ban.vcl
101
+ :language: varnish4
102
102
:emphasize-lines: 8-13
103
103
:linenos:
104
104
105
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-4 /ban.vcl
106
- :language: varnish4
105
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-3 /ban.vcl
106
+ :language: varnish3
107
107
:emphasize-lines: 8-13
108
108
:linenos:
109
109
@@ -117,14 +117,14 @@ to the ``recv`` and the ``deliver`` methods:
117
117
118
118
.. configuration-block ::
119
119
120
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/user_context.vcl
121
- :language: varnish3
122
- :linenos:
123
-
124
120
.. literalinclude :: ../tests/Functional/Fixtures/varnish-4/user_context.vcl
125
121
:language: varnish4
126
122
:linenos:
127
123
124
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/user_context.vcl
125
+ :language: varnish3
126
+ :linenos:
127
+
128
128
.. sidebar :: Caching User Specific Content
129
129
130
130
By default, Varnish does not check for cached data as soon as the request
@@ -174,7 +174,7 @@ To make the hash request cacheable, you must extract a stable user session id.
174
174
You can do this as
175
175
`explained in the Varnish documentation <https://www.varnish-cache.org/trac/wiki/VCLExampleRemovingSomeCookies#RemovingallBUTsomecookies >`_:
176
176
177
- .. code-block :: varnish3
177
+ .. code-block :: varnish4
178
178
:linenos:
179
179
180
180
sub vcl_recv {
@@ -203,13 +203,13 @@ Configure your Varnish to set a debug header that shows whether a cache hit or m
203
203
204
204
.. configuration-block ::
205
205
206
- .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/debug.vcl
207
- :language: varnish3
208
- :linenos:
209
-
210
206
.. literalinclude :: ../tests/Functional/Fixtures/varnish-4/debug.vcl
211
207
:language: varnish4
212
208
:linenos:
213
209
210
+ .. literalinclude :: ../tests/Functional/Fixtures/varnish-3/debug.vcl
211
+ :language: varnish3
212
+ :linenos:
213
+
214
214
.. _`default VCL` : https://www.varnish-cache.org/trac/browser/bin/varnishd/default.vcl?rev=3.0#L63
215
215
0 commit comments