You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add range request support to cache fill + global plugin support (#12391)
* Add range request support to cache fill
* Update cache_fill.test.py
* Add config option to make cache_fill only work for range requests
* Update docs
* Add --cache-range-req config option
Update cache_fill.en.rst
Update cache_fill.en.rst
Update cache_fill.en.rst
* Revert test back to original
wont pass in jenkins, passes locally
Fix test
Update cache_fill.test.py
Update cache_fill.test.py
Revert test back to original
Copy file name to clipboardExpand all lines: doc/admin-guide/plugins/cache_fill.en.rst
+53-4Lines changed: 53 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,20 +24,69 @@ The initial version of this plugin relays the initial request to the origin serv
24
24
This plugin doesn't provide any improvement for smaller objects but could also degrade the performance as two outgoing requests for every cache update.
25
25
26
26
27
-
Using the plugin
28
-
----------------
27
+
Configuration
28
+
-------------
29
+
This plugin functions as either a global or per remap plugin, and it takes an optional argument for
30
+
specifying a config file with inclusion or exclusion criteria. The config file can be specified both
31
+
via an absolute path or via a relative path to the install dir
29
32
30
-
This plugin functions as a per remap plugin.
33
+
To activate the plugin in global mode, in :file:`plugin.config`, simply add::
31
34
32
-
To activate the plugin, in :file:`remap.config`, simply append the
35
+
cache_fill.so --config <config-file>
36
+
37
+
To activate the plugin in per remap mode, in :file:`remap.config`, simply append the
33
38
below to the specific remap line::
34
39
35
40
@plugin=cache_fill.so @pparam=<config-file>
36
41
42
+
include/exclude
43
+
---------------
44
+
The plugin supports a config file that can specify exclusion or inclusion of background fetch
45
+
based on any arbitrary header or client-ip
46
+
47
+
The contents of the config-file could be as below::
48
+
49
+
include User-Agent ABCDEF
50
+
exclude User-Agent *
51
+
exclude Content-Type text
52
+
exclude X-Foo-Bar text
53
+
exclude Content-Length <1000
54
+
exclude Client-IP 127.0.0.1
55
+
include Client-IP 10.0.0.0/16
56
+
57
+
The ``include`` configuration directive is only used when there is a corresponding ``exclude`` to exempt.
58
+
For example, a single line directive, ``include Host example.com`` would not make the plugin
59
+
*only* act on example.com. To achieve classic allow (only) lists, one would need to have a broad
60
+
exclude line, such as::
61
+
62
+
exclude Host *
63
+
include Host example.com
64
+
65
+
range-request-only
66
+
------------------
67
+
When set to ``true``, this plugin will only trigger a background fetch if a range header is present.
68
+
Range headers include ``Range``, ``If-Match``, ``If-Modified-Since``, ``If-None-Match``, ``If-Range``
69
+
and ``If-Unmodified-Since``. By default, this is set to false.
Plugin decides to trigger a background fetch of the original (Client) request if the request/response is cacheable and cache status is TS_CACHE_LOOKUP_MISS/TS_CACHE_LOOKUP_HIT_STALE.
89
+
This will work for range requests by making a background fetch and removing the range header. To disable this feature, set ``--cache-range-req=false``
0 commit comments