mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: cache: Replace the "process-vary" option's expected values
Replace the <0/1> expected values of the process-vary option by a more usual <on/off> pair.
This commit is contained in:
parent
42efffd7f6
commit
e6cc5b5974
@ -14642,12 +14642,12 @@ max-age <seconds>
|
|||||||
seconds, which means that you can't cache an object more than 60 seconds by
|
seconds, which means that you can't cache an object more than 60 seconds by
|
||||||
default.
|
default.
|
||||||
|
|
||||||
process-vary <0 or 1>
|
process-vary <on/off>
|
||||||
Disable or enable the processing of the Vary header. When disabled, a response
|
Enable or disable the processing of the Vary header. When disabled, a response
|
||||||
containing such a header will never be cached. When enabled, we need to calculate
|
containing such a header will never be cached. When enabled, we need to calculate
|
||||||
a preliminary hash for a subset of request headers on all the incoming requests
|
a preliminary hash for a subset of request headers on all the incoming requests
|
||||||
(which might come with a cpu cost) which will be used to build a secondary key
|
(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).
|
for a given request (see RFC 7234#4.1). The default value is off (disabled).
|
||||||
|
|
||||||
max-secondary-entries <number>
|
max-secondary-entries <number>
|
||||||
Define the maximum number of simultaneous secondary entries with the same primary
|
Define the maximum number of simultaneous secondary entries with the same primary
|
||||||
|
4
reg-tests/cache/vary.vtc
vendored
4
reg-tests/cache/vary.vtc
vendored
@ -145,13 +145,13 @@ haproxy h1 -conf {
|
|||||||
total-max-size 3
|
total-max-size 3
|
||||||
max-age 20
|
max-age 20
|
||||||
max-object-size 3072
|
max-object-size 3072
|
||||||
process-vary 1
|
process-vary on
|
||||||
|
|
||||||
cache no_vary_cache
|
cache no_vary_cache
|
||||||
total-max-size 3
|
total-max-size 3
|
||||||
max-age 20
|
max-age 20
|
||||||
max-object-size 3072
|
max-object-size 3072
|
||||||
process-vary 0
|
process-vary off
|
||||||
} -start
|
} -start
|
||||||
|
|
||||||
|
|
||||||
|
2
reg-tests/cache/vary_accept_encoding.vtc
vendored
2
reg-tests/cache/vary_accept_encoding.vtc
vendored
@ -98,7 +98,7 @@ haproxy h1 -conf {
|
|||||||
total-max-size 3
|
total-max-size 3
|
||||||
max-age 20
|
max-age 20
|
||||||
max-object-size 3072
|
max-object-size 3072
|
||||||
process-vary 1
|
process-vary on
|
||||||
} -start
|
} -start
|
||||||
|
|
||||||
|
|
||||||
|
13
src/cache.c
13
src/cache.c
@ -1981,12 +1981,19 @@ int cfg_parse_cache(const char *file, int linenum, char **args, int kwm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!*args[1]) {
|
if (!*args[1]) {
|
||||||
ha_warning("parsing [%s:%d]: '%s' expects 0 or 1 (disable or enable vary processing).\n",
|
ha_warning("parsing [%s:%d]: '%s' expects \"on\" or \"off\" (enable or disable vary processing).\n",
|
||||||
|
file, linenum, args[0]);
|
||||||
|
err_code |= ERR_WARN;
|
||||||
|
}
|
||||||
|
if (strcmp(args[1], "on") == 0)
|
||||||
|
tmp_cache_config->vary_processing_enabled = 1;
|
||||||
|
else if (strcmp(args[1], "off") == 0)
|
||||||
|
tmp_cache_config->vary_processing_enabled = 0;
|
||||||
|
else {
|
||||||
|
ha_warning("parsing [%s:%d]: '%s' expects \"on\" or \"off\" (enable or disable vary processing).\n",
|
||||||
file, linenum, args[0]);
|
file, linenum, args[0]);
|
||||||
err_code |= ERR_WARN;
|
err_code |= ERR_WARN;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_cache_config->vary_processing_enabled = atoi(args[1]);
|
|
||||||
} else if (strcmp(args[0], "max-secondary-entries") == 0) {
|
} else if (strcmp(args[0], "max-secondary-entries") == 0) {
|
||||||
unsigned int max_sec_entries;
|
unsigned int max_sec_entries;
|
||||||
char *err;
|
char *err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user