You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/06/15 16:21:32 UTC
[trafficserver] branch master updated: Removes the explicit Vary
configurations and code
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new d34c192 Removes the explicit Vary configurations and code
d34c192 is described below
commit d34c1923d5be5fc7d726fb393c9cda6a950e2f96
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Fri Jun 7 15:06:37 2019 -0600
Removes the explicit Vary configurations and code
---
doc/admin-guide/configuration/cache-basics.en.rst | 28 +---
doc/admin-guide/files/records.config.en.rst | 27 ----
doc/admin-guide/plugins/lua.en.rst | 4 -
.../api/functions/TSHttpOverridableConfig.en.rst | 4 -
.../api/types/TSOverridableConfigKey.en.rst | 4 -
.../admin-guide/configuration/cache-basics.en.po | 16 ---
include/ts/apidefs.h.in | 4 -
lib/perl/lib/Apache/TS/AdminClient.pm | 4 -
mgmt/RecordsConfig.cc | 12 --
plugins/lua/ts_lua_http_config.c | 8 --
proxy/hdrs/HttpCompat.cc | 4 +-
proxy/hdrs/HttpCompat.h | 2 +-
proxy/http/HttpConfig.cc | 28 ++--
proxy/http/HttpConfig.h | 9 --
proxy/http/HttpTransactCache.cc | 158 ++++++++-------------
src/traffic_server/InkAPI.cc | 17 ---
src/traffic_server/InkAPITest.cc | 4 -
17 files changed, 74 insertions(+), 259 deletions(-)
diff --git a/doc/admin-guide/configuration/cache-basics.en.rst b/doc/admin-guide/configuration/cache-basics.en.rst
index d8a86f7..8416a04 100644
--- a/doc/admin-guide/configuration/cache-basics.en.rst
+++ b/doc/admin-guide/configuration/cache-basics.en.rst
@@ -592,31 +592,8 @@ whether a server delivers content for different languages, targets
different browsers with different presentation styles, or provides
different document formats (HTML, XML). Different versions of the same
object are termed *alternates* and are cached by Traffic Server based
-on ``Vary`` response headers. You can specify additional request and
-response headers for specific ``Content-Type`` values that Traffic Server
-will identify as alternates for caching. You can also limit the number
-of alternate versions of an object allowed in the cache.
-
-Configuring How Traffic Server Caches Alternates
-------------------------------------------------
-
-To configure how Traffic Server caches alternates:
-
-#. Edit the following variables in :file:`records.config`:
-
- - :ts:cv:`proxy.config.http.cache.enable_default_vary_headers`
- - :ts:cv:`proxy.config.http.cache.vary_default_text`
- - :ts:cv:`proxy.config.http.cache.vary_default_images`
- - :ts:cv:`proxy.config.http.cache.vary_default_other`
-
-#. Run the command :option:`traffic_ctl config reload` to apply the configuration changes.
-
-.. note::
-
- If you specify ``Cookie`` as the header field on which to vary
- in the above variables, make sure that the variable
- :ts:cv:`proxy.config.http.cache.cache_responses_to_cookies`
- is set appropriately.
+on ``Vary`` response headers. You can also limit the number of
+alternate versions of an object allowed in the cache.
Limiting the Number of Alternates for an Object
-----------------------------------------------
@@ -816,4 +793,3 @@ In addition to the open read retry settings TS supports a new setting
reduce multiple concurrent requests hitting the origin for the same object by
either returning a stale copy, in case of hit-stale or an error in case of cache
miss for all but one of the requests.
-
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 3fcb13a..0c3f0a0 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1945,12 +1945,6 @@ Cache Control
mark (``?``), a semicolon (``;``), or ``cgi``. For a full list, please refer to
`HttpTransact::url_looks_dynamic </link/to/doxygen>`_
-.. ts:cv:: CONFIG proxy.config.http.cache.enable_default_vary_headers INT 0
- :reloadable:
- :overridable:
-
- Enables (``1``) or disables (``0``) caching of alternate versions of HTTP objects that do not contain the ``Vary`` header.
-
.. ts:cv:: CONFIG proxy.config.http.cache.when_to_revalidate INT 0
:reloadable:
:overridable:
@@ -2236,27 +2230,6 @@ Heuristic Expiration
Dynamic Content & Content Negotiation
=====================================
-.. ts:cv:: CONFIG proxy.config.http.cache.vary_default_text STRING NULL
- :reloadable:
- :overridable:
-
- The header on which |TS| varies for text documents.
-
-For example: if you specify ``User-agent``, then |TS| caches
-all the different user-agent versions of documents it encounters.
-
-.. ts:cv:: CONFIG proxy.config.http.cache.vary_default_images STRING NULL
- :reloadable:
- :overridable:
-
- The header on which |TS| varies for images.
-
-.. ts:cv:: CONFIG proxy.config.http.cache.vary_default_other STRING NULL
- :reloadable:
- :overridable:
-
- The header on which |TS| varies for anything other than text and images.
-
.. ts:cv:: CONFIG proxy.config.http.cache.open_read_retry_time INT 10
:reloadable:
:overridable:
diff --git a/doc/admin-guide/plugins/lua.en.rst b/doc/admin-guide/plugins/lua.en.rst
index 1567919..c2476c0 100644
--- a/doc/admin-guide/plugins/lua.en.rst
+++ b/doc/admin-guide/plugins/lua.en.rst
@@ -3376,10 +3376,6 @@ Http config constants
TS_LUA_CONFIG_SSL_CERT_FILENAME
TS_LUA_CONFIG_SSL_CERT_FILEPATH
TS_LUA_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB
- TS_LUA_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH
diff --git a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
index 09a5a02..a3c063b 100644
--- a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
+++ b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst
@@ -80,7 +80,6 @@ TSOverridableConfigKey Value Configuratio
:c:macro:`TS_CONFIG_HTTP_BACKGROUND_FILL_COMPLETED_THRESHOLD` :ts:cv:`proxy.config.http.background_fill_completed_threshold`
:c:macro:`TS_CONFIG_HTTP_CACHE_CACHE_RESPONSES_TO_COOKIES` :ts:cv:`proxy.config.http.cache.cache_responses_to_cookies`
:c:macro:`TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC` :ts:cv:`proxy.config.http.cache.cache_urls_that_look_dynamic`
-:c:macro:`TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER` :ts:cv:`proxy.config.http.cache.enable_default_vary_headers`
:c:macro:`TS_CONFIG_HTTP_CACHE_GENERATION` :ts:cv:`proxy.config.http.cache.generation`
:c:macro:`TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME` :ts:cv:`proxy.config.http.cache.guaranteed_max_lifetime`
:c:macro:`TS_CONFIG_HTTP_CACHE_GUARANTEED_MIN_LIFETIME` :ts:cv:`proxy.config.http.cache.guaranteed_min_lifetime`
@@ -105,9 +104,6 @@ TSOverridableConfigKey Value Configuratio
:c:macro:`TS_CONFIG_HTTP_CACHE_RANGE_LOOKUP` :ts:cv:`proxy.config.http.cache.range.lookup`
:c:macro:`TS_CONFIG_HTTP_CACHE_RANGE_WRITE` :ts:cv:`proxy.config.http.cache.range.write`
:c:macro:`TS_CONFIG_HTTP_CACHE_REQUIRED_HEADERS` :ts:cv:`proxy.config.http.cache.required_headers`
-:c:macro:`TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES` :ts:cv:`proxy.config.http.cache.vary_default_images`
-:c:macro:`TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER` :ts:cv:`proxy.config.http.cache.vary_default_other`
-:c:macro:`TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT` :ts:cv:`proxy.config.http.cache.vary_default_text`
:c:macro:`TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE` :ts:cv:`proxy.config.http.cache.when_to_revalidate`
:c:macro:`TS_CONFIG_HTTP_CHUNKING_ENABLED` :ts:cv:`proxy.config.http.chunking_enabled`
:c:macro:`TS_CONFIG_HTTP_CHUNKING_SIZE` :ts:cv:`proxy.config.http.chunking.size`
diff --git a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
index e4d3ff5..7eeb349 100644
--- a/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
+++ b/doc/developer-guide/api/types/TSOverridableConfigKey.en.rst
@@ -131,10 +131,6 @@ Enumeration Members
.. c:macro:: TS_CONFIG_SSL_CLIENT_CERT_FILENAME
.. c:macro:: TS_CONFIG_SSL_CERT_FILEPATH
.. c:macro:: TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB
- .. c:macro:: TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER
- .. c:macro:: TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT
- .. c:macro:: TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES
- .. c:macro:: TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER
.. c:macro:: TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH
.. c:macro:: TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH
.. c:macro:: TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH
diff --git a/doc/locale/ja/LC_MESSAGES/admin-guide/configuration/cache-basics.en.po b/doc/locale/ja/LC_MESSAGES/admin-guide/configuration/cache-basics.en.po
index 314cb7c..c69382a 100644
--- a/doc/locale/ja/LC_MESSAGES/admin-guide/configuration/cache-basics.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin-guide/configuration/cache-basics.en.po
@@ -1186,22 +1186,6 @@ msgstr "Traffic Server が代替をキャッシュするように設定するに
msgid "Edit the following variables in :file:`records.config`:"
msgstr ":file:`records.config` の次の変数を編集してください :"
-#: ../../../admin-guide/configuration/cache-basics.en.rst:607
-msgid ":ts:cv:`proxy.config.http.cache.enable_default_vary_headers`"
-msgstr ":ts:cv:`proxy.config.http.cache.enable_default_vary_headers`"
-
-#: ../../../admin-guide/configuration/cache-basics.en.rst:608
-msgid ":ts:cv:`proxy.config.http.cache.vary_default_text`"
-msgstr ":ts:cv:`proxy.config.http.cache.vary_default_text`"
-
-#: ../../../admin-guide/configuration/cache-basics.en.rst:609
-msgid ":ts:cv:`proxy.config.http.cache.vary_default_images`"
-msgstr ":ts:cv:`proxy.config.http.cache.vary_default_images`"
-
-#: ../../../admin-guide/configuration/cache-basics.en.rst:610
-msgid ":ts:cv:`proxy.config.http.cache.vary_default_other`"
-msgstr ":ts:cv:`proxy.config.http.cache.vary_default_other`"
-
#: ../../../admin-guide/configuration/cache-basics.en.rst:616
msgid ""
"If you specify ``Cookie`` as the header field on which to vary in the above "
diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in
index cbc28a1..c6f1c9b 100644
--- a/include/ts/apidefs.h.in
+++ b/include/ts/apidefs.h.in
@@ -793,10 +793,6 @@ typedef enum {
TS_CONFIG_SSL_CLIENT_CERT_FILENAME = TS_CONFIG_SSL_CERT_FILENAME,
TS_CONFIG_SSL_CERT_FILEPATH,
TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB,
- TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER,
- TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT,
- TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES,
- TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER,
TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH,
TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH,
TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH,
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index dc3b6c5..5bc456b 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -415,7 +415,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
proxy.config.http.background_fill_completed_threshold
proxy.config.http.cache.cache_responses_to_cookies
proxy.config.http.cache.cache_urls_that_look_dynamic
- proxy.config.http.cache.enable_default_vary_headers
proxy.config.http.cache.guaranteed_max_lifetime
proxy.config.http.cache.guaranteed_min_lifetime
proxy.config.http.cache.heuristic_lm_factor
@@ -438,9 +437,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
proxy.config.http.cache.range.lookup
proxy.config.http.cache.range.write
proxy.config.http.cache.required_headers
- proxy.config.http.cache.vary_default_images
- proxy.config.http.cache.vary_default_other
- proxy.config.http.cache.vary_default_text
proxy.config.http.cache.when_to_revalidate
proxy.config.http.chunking_enabled
proxy.config.http.connect_attempts_max_retries
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 7a2155f..eac90b9 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -584,8 +584,6 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.cache.cache_urls_that_look_dynamic", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
- {RECT_CONFIG, "proxy.config.http.cache.enable_default_vary_headers", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
- ,
{RECT_CONFIG, "proxy.config.http.cache.post_method", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.cache.max_open_read_retries", RECD_INT, "-1", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
@@ -642,16 +640,6 @@ static const RecordElement RecordsConfig[] =
{RECT_CONFIG, "proxy.config.http.cache.guaranteed_max_lifetime", RECD_INT, "31536000", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
- // #########################################
- // # dynamic content & content negotiation #
- // #########################################
- {RECT_CONFIG, "proxy.config.http.cache.vary_default_text", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
- ,
- {RECT_CONFIG, "proxy.config.http.cache.vary_default_images", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
- ,
- {RECT_CONFIG, "proxy.config.http.cache.vary_default_other", RECD_STRING, nullptr, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
- ,
-
// ###################
// # Error Reporting #
// ###################
diff --git a/plugins/lua/ts_lua_http_config.c b/plugins/lua/ts_lua_http_config.c
index a01018e..043387b 100644
--- a/plugins/lua/ts_lua_http_config.c
+++ b/plugins/lua/ts_lua_http_config.c
@@ -118,10 +118,6 @@ typedef enum {
TS_LUA_CONFIG_SSL_CERT_FILENAME = TS_CONFIG_SSL_CERT_FILENAME,
TS_LUA_CONFIG_SSL_CERT_FILEPATH = TS_CONFIG_SSL_CERT_FILEPATH,
TS_LUA_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB = TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB,
- TS_LUA_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER = TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER,
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT,
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES,
- TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER,
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH,
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH,
TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH,
@@ -247,10 +243,6 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_SSL_CERT_FILENAME),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_SSL_CERT_FILEPATH),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES),
- TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH),
diff --git a/proxy/hdrs/HttpCompat.cc b/proxy/hdrs/HttpCompat.cc
index 718b019..6c9e3e5 100644
--- a/proxy/hdrs/HttpCompat.cc
+++ b/proxy/hdrs/HttpCompat.cc
@@ -407,7 +407,7 @@ HttpCompat::parse_mime_type_with_len(const char *mime_string, int mime_string_le
//////////////////////////////////////////////////////////////////////////////
//
-// bool HttpCompat::do_header_values_match(MIMEField *hv1, MIMEField *hv2)
+// bool HttpCompat::do_vary_header_values_match(MIMEField *hv1, MIMEField *hv2)
//
// This routine takes two HTTP header fields and determines
// if their values "match", as in section 14.43 of RFC2068:
@@ -430,7 +430,7 @@ HttpCompat::parse_mime_type_with_len(const char *mime_string, int mime_string_le
//
//////////////////////////////////////////////////////////////////////////////
bool
-HttpCompat::do_header_values_rfc2068_14_43_match(MIMEField *hdr1, MIMEField *hdr2)
+HttpCompat::do_vary_header_values_match(MIMEField *hdr1, MIMEField *hdr2)
{
// If both headers are missing, the headers match.
if (!hdr1 && !hdr2) {
diff --git a/proxy/hdrs/HttpCompat.h b/proxy/hdrs/HttpCompat.h
index 8c23799..47ca8be 100644
--- a/proxy/hdrs/HttpCompat.h
+++ b/proxy/hdrs/HttpCompat.h
@@ -44,7 +44,7 @@ public:
static void parse_mime_type_with_len(const char *mime_string, int mime_string_len, char *type, char *subtype, int type_len,
int subtype_len);
- static bool do_header_values_rfc2068_14_43_match(MIMEField *hv1, MIMEField *hv2);
+ static bool do_vary_header_values_match(MIMEField *hv1, MIMEField *hv2);
static float find_Q_param_in_strlist(StrList *strlist);
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index a051224..a72d12d 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1120,10 +1120,6 @@ HttpConfig::startup()
HttpEstablishStaticConfigByte(c.oride.allow_half_open, "proxy.config.http.allow_half_open");
- HttpEstablishStaticConfigStringAlloc(c.oride.cache_vary_default_text, "proxy.config.http.cache.vary_default_text");
- HttpEstablishStaticConfigStringAlloc(c.oride.cache_vary_default_images, "proxy.config.http.cache.vary_default_images");
- HttpEstablishStaticConfigStringAlloc(c.oride.cache_vary_default_other, "proxy.config.http.cache.vary_default_other");
-
// open read failure retries
HttpEstablishStaticConfigLongLong(c.oride.max_cache_open_read_retries, "proxy.config.http.cache.max_open_read_retries");
HttpEstablishStaticConfigLongLong(c.oride.cache_open_read_retry_time, "proxy.config.http.cache.open_read_retry_time");
@@ -1141,7 +1137,6 @@ HttpConfig::startup()
HttpEstablishStaticConfigByte(c.oride.cache_ignore_auth, "proxy.config.http.cache.ignore_authentication");
HttpEstablishStaticConfigByte(c.oride.cache_urls_that_look_dynamic, "proxy.config.http.cache.cache_urls_that_look_dynamic");
- HttpEstablishStaticConfigByte(c.oride.cache_enable_default_vary_headers, "proxy.config.http.cache.enable_default_vary_headers");
HttpEstablishStaticConfigByte(c.cache_post_method, "proxy.config.http.cache.post_method");
HttpEstablishStaticConfigByte(c.oride.ignore_accept_mismatch, "proxy.config.http.cache.ignore_accept_mismatch");
@@ -1402,10 +1397,6 @@ HttpConfig::reconfigure()
params->oride.cache_max_stale_age = m_master.oride.cache_max_stale_age;
- params->oride.cache_vary_default_text = ats_strdup(m_master.oride.cache_vary_default_text);
- params->oride.cache_vary_default_images = ats_strdup(m_master.oride.cache_vary_default_images);
- params->oride.cache_vary_default_other = ats_strdup(m_master.oride.cache_vary_default_other);
-
params->oride.srv_enabled = m_master.oride.srv_enabled;
params->oride.allow_half_open = m_master.oride.allow_half_open;
@@ -1418,16 +1409,15 @@ HttpConfig::reconfigure()
// open write failure retries
params->oride.max_cache_open_write_retries = m_master.oride.max_cache_open_write_retries;
- params->oride.cache_http = INT_TO_BOOL(m_master.oride.cache_http);
- params->oride.cache_ignore_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_client_no_cache);
- params->oride.cache_ignore_client_cc_max_age = INT_TO_BOOL(m_master.oride.cache_ignore_client_cc_max_age);
- params->oride.cache_ims_on_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ims_on_client_no_cache);
- params->oride.cache_ignore_server_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_server_no_cache);
- params->oride.cache_responses_to_cookies = m_master.oride.cache_responses_to_cookies;
- params->oride.cache_ignore_auth = INT_TO_BOOL(m_master.oride.cache_ignore_auth);
- params->oride.cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.oride.cache_urls_that_look_dynamic);
- params->oride.cache_enable_default_vary_headers = INT_TO_BOOL(m_master.oride.cache_enable_default_vary_headers);
- params->cache_post_method = INT_TO_BOOL(m_master.cache_post_method);
+ params->oride.cache_http = INT_TO_BOOL(m_master.oride.cache_http);
+ params->oride.cache_ignore_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_client_no_cache);
+ params->oride.cache_ignore_client_cc_max_age = INT_TO_BOOL(m_master.oride.cache_ignore_client_cc_max_age);
+ params->oride.cache_ims_on_client_no_cache = INT_TO_BOOL(m_master.oride.cache_ims_on_client_no_cache);
+ params->oride.cache_ignore_server_no_cache = INT_TO_BOOL(m_master.oride.cache_ignore_server_no_cache);
+ params->oride.cache_responses_to_cookies = m_master.oride.cache_responses_to_cookies;
+ params->oride.cache_ignore_auth = INT_TO_BOOL(m_master.oride.cache_ignore_auth);
+ params->oride.cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.oride.cache_urls_that_look_dynamic);
+ params->cache_post_method = INT_TO_BOOL(m_master.cache_post_method);
params->oride.ignore_accept_mismatch = m_master.oride.ignore_accept_mismatch;
params->oride.ignore_accept_language_mismatch = m_master.oride.ignore_accept_language_mismatch;
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 48472e2..b148666 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -510,8 +510,6 @@ struct OverridableHttpConfigParams {
MgmtByte cache_range_write = 0;
MgmtByte allow_multi_range = 0;
- MgmtByte cache_enable_default_vary_headers = 0;
-
MgmtByte ignore_accept_mismatch = 0;
MgmtByte ignore_accept_language_mismatch = 0;
MgmtByte ignore_accept_encoding_mismatch = 0;
@@ -674,10 +672,6 @@ struct OverridableHttpConfigParams {
char *ssl_client_cert_filename = nullptr;
char *ssl_client_private_key_filename = nullptr;
char *ssl_client_ca_cert_filename = nullptr;
-
- char *cache_vary_default_text = nullptr;
- char *cache_vary_default_images = nullptr;
- char *cache_vary_default_other = nullptr;
};
/////////////////////////////////////////////////////////////
@@ -846,9 +840,6 @@ inline HttpConfigParams::~HttpConfigParams()
ats_free(oride.ssl_client_cert_filename);
ats_free(oride.ssl_client_private_key_filename);
ats_free(oride.ssl_client_ca_cert_filename);
- ats_free(oride.cache_vary_default_text);
- ats_free(oride.cache_vary_default_images);
- ats_free(oride.cache_vary_default_other);
ats_free(connect_ports_string);
ats_free(reverse_proxy_no_host_redirect);
ats_free(redirect_actions_string);
diff --git a/proxy/http/HttpTransactCache.cc b/proxy/http/HttpTransactCache.cc
index cdff3f9..eb51039 100644
--- a/proxy/http/HttpTransactCache.cc
+++ b/proxy/http/HttpTransactCache.cc
@@ -1138,115 +1138,77 @@ HttpTransactCache::CalcVariability(OverridableHttpConfigParams *http_config_para
ink_assert(obj_origin_server_response != nullptr);
Variability_t variability = VARIABILITY_NONE;
- if (http_config_params->cache_enable_default_vary_headers || obj_origin_server_response->presence(MIME_PRESENCE_VARY)) {
- ///////////////////////////////////////////////////////////////////////
- // If the origin server sent a Vary header in the response, use that //
- // Vary, otherwise use the default. Ivry adds: However if the origin //
- // server was a non-compliant 1.1 and did not send a Vary header, //
- // treat as 1.0 with no Vary header. //
- ///////////////////////////////////////////////////////////////////////
+ if (obj_origin_server_response->presence(MIME_PRESENCE_VARY)) {
StrList vary_list;
- int num_vary_values = obj_origin_server_response->value_get_comma_list(MIME_FIELD_VARY, MIME_LEN_VARY, &vary_list);
- if (num_vary_values <= 0) { // no vary hdr, so use defaults if enabled
- const char *vary_values = nullptr;
- const char *content_type;
- int content_type_len;
- char type[32], subtype[32];
-
- content_type = obj_origin_server_response->value_get(MIME_FIELD_CONTENT_TYPE, MIME_LEN_CONTENT_TYPE, &content_type_len);
-
- if (content_type) {
- HttpCompat::parse_mime_type_with_len(content_type, content_type_len, type, subtype, sizeof(type), sizeof(subtype));
- } else {
- type[0] = '\0';
- subtype[0] = '\0';
+ if (obj_origin_server_response->value_get_comma_list(MIME_FIELD_VARY, MIME_LEN_VARY, &vary_list) > 0) {
+ if (is_debug_tag_set("http_match") && vary_list.head) {
+ Debug("http_match", "Vary list of %d elements", vary_list.count);
+ vary_list.dump(stderr);
}
- Debug("http_match", " type = '%s', subtype = '%s'", type, subtype);
-
- if (http_config_params->cache_enable_default_vary_headers) {
- if (strcasecmp(type, "text") == 0) {
- Debug("http_match", " Using default text vary headers");
- vary_values = http_config_params->cache_vary_default_text;
- } else if (strcasecmp(type, "image") == 0) {
- Debug("http_match", " Using default image vary headers");
- vary_values = http_config_params->cache_vary_default_images;
- } else {
- Debug("http_match", " Using default other vary headers");
- vary_values = http_config_params->cache_vary_default_other;
+ // for each field that varies, see if current & original hdrs match //
+ for (Str *field = vary_list.head; field != nullptr; field = field->next) {
+ if (field->len == 0) {
+ continue;
}
- }
- // convert the comma-sep string from the config var into a list
- HttpCompat::parse_comma_list(&vary_list, (vary_values ? vary_values : ""));
- }
- if (is_debug_tag_set("http_match") && (vary_list.head)) {
- Debug("http_match", "Vary list of %d elements", vary_list.count);
- vary_list.dump(stderr);
- }
+ /////////////////////////////////////////////////////////////
+ // If the field name is unhandled, we should probably do a //
+ // string comparison on the values of this extension field //
+ // but currently we just treat it equivalent to a '*'. //
+ /////////////////////////////////////////////////////////////
- // for each field that varies, see if current & original hdrs match //
- for (Str *field = vary_list.head; field != nullptr; field = field->next) {
- if (field->len == 0) {
- continue;
- }
-
- /////////////////////////////////////////////////////////////
- // If the field name is unhandled, we should probably do a //
- // string comparison on the values of this extension field //
- // but currently we just treat it equivalent to a '*'. //
- /////////////////////////////////////////////////////////////
-
- Debug("http_match", "Vary: %s", field->str);
- if (((field->str[0] == '*') && (field->str[1] == NUL))) {
- Debug("http_match", "Wildcard variability --- object not served from cache");
- variability = VARIABILITY_ALL;
- break;
- }
- ////////////////////////////////////////////////////////////////////////////////////////
- // Special case: if 'proxy.config.http.global_user_agent_header' set //
- // we should ignore Vary: User-Agent. //
- ////////////////////////////////////////////////////////////////////////////////////////
- if (http_config_params->global_user_agent_header && !strcasecmp((char *)field->str, "User-Agent")) {
- continue;
- }
+ Debug("http_match", "Vary: %s", field->str);
+ if (((field->str[0] == '*') && (field->str[1] == NUL))) {
+ Debug("http_match", "Wildcard variability --- object not served from cache");
+ variability = VARIABILITY_ALL;
+ break;
+ }
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // Special case: if 'proxy.config.http.global_user_agent_header' set //
+ // we should ignore Vary: User-Agent. //
+ ////////////////////////////////////////////////////////////////////////////////////////
+ if (http_config_params->global_user_agent_header && !strcasecmp((char *)field->str, "User-Agent")) {
+ continue;
+ }
- // Disable Vary mismatch checking for Accept-Encoding. This is only safe to
- // set if you are promising to fix any Accept-Encoding/Content-Encoding mismatches.
- if (http_config_params->ignore_accept_encoding_mismatch && !strcasecmp((char *)field->str, "Accept-Encoding")) {
- continue;
- }
+ // Disable Vary mismatch checking for Accept-Encoding. This is only safe to
+ // set if you are promising to fix any Accept-Encoding/Content-Encoding mismatches.
+ if (http_config_params->ignore_accept_encoding_mismatch && !strcasecmp((char *)field->str, "Accept-Encoding")) {
+ continue;
+ }
- ///////////////////////////////////////////////////////////////////
- // Take the current vary field and look up the headers in //
- // the current client, and the original client. The cached //
- // object varies unless BOTH the current client and the original //
- // client contain the header, and the header values are equal. //
- // We relax this to allow a match if NEITHER have the header. //
- // //
- // While header "equality" appears to be header-specific, the //
- // RFC2068 spec implies that matching only needs to account for //
- // differences in whitespace and support for multiple headers //
- // with the same name. Case is presumably also insignificant. //
- // Other variations (such as q=1 vs. a field with no q factor) //
- // mean that the values DO NOT match. //
- ///////////////////////////////////////////////////////////////////
-
- ink_assert(strlen(field->str) == field->len);
-
- char *field_name_str = (char *)hdrtoken_string_to_wks(field->str, field->len);
- if (field_name_str == nullptr) {
- field_name_str = (char *)field->str;
- }
+ ///////////////////////////////////////////////////////////////////
+ // Take the current vary field and look up the headers in //
+ // the current client, and the original client. The cached //
+ // object varies unless BOTH the current client and the original //
+ // client contain the header, and the header values are equal. //
+ // We relax this to allow a match if NEITHER have the header. //
+ // //
+ // While header "equality" appears to be header-specific, the //
+ // RFC2068 spec implies that matching only needs to account for //
+ // differences in whitespace and support for multiple headers //
+ // with the same name. Case is presumably also insignificant. //
+ // Other variations (such as q=1 vs. a field with no q factor) //
+ // mean that the values DO NOT match. //
+ ///////////////////////////////////////////////////////////////////
+
+ ink_assert(strlen(field->str) == field->len);
+
+ char *field_name_str = (char *)hdrtoken_string_to_wks(field->str, field->len);
+ if (field_name_str == nullptr) {
+ field_name_str = (char *)field->str;
+ }
- MIMEField *cached_hdr_field = obj_client_request->field_find(field_name_str, field->len);
- MIMEField *current_hdr_field = client_request->field_find(field_name_str, field->len);
+ MIMEField *cached_hdr_field = obj_client_request->field_find(field_name_str, field->len);
+ MIMEField *current_hdr_field = client_request->field_find(field_name_str, field->len);
- // Header values match? //
- if (!HttpCompat::do_header_values_rfc2068_14_43_match(cached_hdr_field, current_hdr_field)) {
- variability = VARIABILITY_SOME;
- break;
+ // Header values match? //
+ if (!HttpCompat::do_vary_header_values_match(cached_hdr_field, current_hdr_field)) {
+ variability = VARIABILITY_SOME;
+ break;
+ }
}
}
}
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 7597291..e89fd30 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -8310,18 +8310,6 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
case TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB:
ret = _memberp_to_generic(&overridableHttpConfig->parent_failures_update_hostdb, conv);
break;
- case TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER:
- ret = _memberp_to_generic(&overridableHttpConfig->cache_enable_default_vary_headers, conv);
- break;
- case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT:
- ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_text, conv);
- break;
- case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES:
- ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_images, conv);
- break;
- case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER:
- ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_other, conv);
- break;
case TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH:
ret = _memberp_to_generic(&overridableHttpConfig->ignore_accept_mismatch, conv);
break;
@@ -8636,13 +8624,11 @@ static const std::unordered_map<std::string_view, std::tuple<const TSOverridable
{"proxy.config.http.parent_proxy.retry_time", {TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.insert_response_via_str", {TS_CONFIG_HTTP_INSERT_RESPONSE_VIA_STR, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.flow_control.high_water", {TS_CONFIG_HTTP_FLOW_CONTROL_HIGH_WATER_MARK, TS_RECORDDATATYPE_INT}},
- {"proxy.config.http.cache.vary_default_text", {TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT, TS_RECORDDATATYPE_STRING}},
{"proxy.config.http.negative_caching_enabled", {TS_CONFIG_HTTP_NEGATIVE_CACHING_ENABLED, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.when_to_revalidate", {TS_CONFIG_HTTP_CACHE_WHEN_TO_REVALIDATE, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.response_header_max_size", {TS_CONFIG_HTTP_RESPONSE_HEADER_MAX_SIZE, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.anonymize_remove_referer", {TS_CONFIG_HTTP_ANONYMIZE_REMOVE_REFERER, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.global_user_agent_header", {TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER, TS_RECORDDATATYPE_STRING}},
- {"proxy.config.http.cache.vary_default_other", {TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER, TS_RECORDDATATYPE_STRING}},
{"proxy.config.net.sock_recv_buffer_size_out", {TS_CONFIG_NET_SOCK_RECV_BUFFER_SIZE_OUT, TS_RECORDDATATYPE_INT}},
{"proxy.config.net.sock_send_buffer_size_out", {TS_CONFIG_NET_SOCK_SEND_BUFFER_SIZE_OUT, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.connect_attempts_timeout", {TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT, TS_RECORDDATATYPE_INT}},
@@ -8650,7 +8636,6 @@ static const std::unordered_map<std::string_view, std::tuple<const TSOverridable
{"proxy.config.http.negative_caching_lifetime", {TS_CONFIG_HTTP_NEGATIVE_CACHING_LIFETIME, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.default_buffer_water_mark", {TS_CONFIG_HTTP_DEFAULT_BUFFER_WATER_MARK, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.heuristic_lm_factor", {TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR, TS_RECORDDATATYPE_FLOAT}},
- {"proxy.config.http.cache.vary_default_images", {TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES, TS_RECORDDATATYPE_STRING}},
{OutboundConnTrack::CONFIG_VAR_MAX, {TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MAX, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.anonymize_remove_client_ip", {TS_CONFIG_HTTP_ANONYMIZE_REMOVE_CLIENT_IP, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.open_read_retry_time", {TS_CONFIG_HTTP_CACHE_OPEN_READ_RETRY_TIME, TS_RECORDDATATYPE_INT}},
@@ -8691,8 +8676,6 @@ static const std::unordered_map<std::string_view, std::tuple<const TSOverridable
{TS_CONFIG_HTTP_KEEP_ALIVE_NO_ACTIVITY_TIMEOUT_IN, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.post.check.content_length.enabled",
{TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED, TS_RECORDDATATYPE_INT}},
- {"proxy.config.http.cache.enable_default_vary_headers",
- {TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.cache.cache_urls_that_look_dynamic",
{TS_CONFIG_HTTP_CACHE_CACHE_URLS_THAT_LOOK_DYNAMIC, TS_RECORDDATATYPE_INT}},
{"proxy.config.http.transaction_no_activity_timeout_in",
diff --git a/src/traffic_server/InkAPITest.cc b/src/traffic_server/InkAPITest.cc
index 9380890..08cecb6 100644
--- a/src/traffic_server/InkAPITest.cc
+++ b/src/traffic_server/InkAPITest.cc
@@ -8649,10 +8649,6 @@ std::array<std::string_view, TS_CONFIG_LAST_ENTRY> SDK_Overridable_Configs = {
"proxy.config.ssl.client.cert.filename",
"proxy.config.ssl.client.cert.path",
"proxy.config.http.parent_proxy.mark_down_hostdb",
- "proxy.config.http.cache.enable_default_vary_headers",
- "proxy.config.http.cache.vary_default_text",
- "proxy.config.http.cache.vary_default_images",
- "proxy.config.http.cache.vary_default_other",
"proxy.config.http.cache.ignore_accept_mismatch",
"proxy.config.http.cache.ignore_accept_language_mismatch",
"proxy.config.http.cache.ignore_accept_encoding_mismatch",