MINOR: cache: Add a max-secondary-entries cache option
This new option allows to tune the maximum number of simultaneous
entries with the same primary key in the cache (secondary entries).
When we try to store a response in the cache and there are already
max-secondary-entries living entries in the cache, the storage will
fail (but the response will still be sent to the client).
It defaults to 10 and does not have a maximum number.
diff --git a/doc/configuration.txt b/doc/configuration.txt
index ec1f249..e60e342 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -14606,6 +14606,8 @@
- If the response does not have an explicit expiration time (s-maxage or max-age
Cache-Control directives or Expires header) or a validator (ETag or Last-Modified
headers)
+- If the process-vary option is enabled and there are already max-secondary-entries
+ entries with the same primary key as the current response
- If the request is not a GET
- If the HTTP version of the request is smaller than 1.1
@@ -14636,7 +14638,7 @@
All objects with sizes larger than "max-object-size" will not be cached.
max-age <seconds>
- Define the maximum expiration duration. The expiration is set has the lowest
+ Define the maximum expiration duration. The expiration is set as the lowest
value between the s-maxage or max-age (in this order) directive in the
Cache-Control response header and this value. The default value is 60
seconds, which means that you can't cache an object more than 60 seconds by
@@ -14649,6 +14651,11 @@
(which might come with a cpu cost) which will be used to build a secondary key
for a given request (see RFC 7234#4.1). The default value is 0 (disabled).
+max-secondary-entries <number>
+ Define the maximum number of simultaneous secondary entries with the same primary
+ key in the cache. This needs the vary support to be enabled. Its default value is 10
+ and should be passed a strictly positive integer.
+
6.2.2. Proxy section
---------------------