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 2017/04/25 20:30:00 UTC

[trafficserver] branch master updated (8d2901e -> 487d829)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.

      from  8d2901e   Bump master to v8.0.0
       new  c0c1c1b   Eliminates CacheLookupHttpConfig (clustering communications)
       new  487d829   Removes the HTTP_CACHE define, the cache is always enabled now

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 cmd/traffic_layout/traffic_layout.cc             |   1 -
 doc/admin-guide/files/records.config.en.rst      |   8 ++
 iocore/cache/Cache.cc                            |  31 +------
 iocore/cache/CacheHttp.cc                        |  98 --------------------
 iocore/cache/CacheRead.cc                        |  43 ++-------
 iocore/cache/CacheVol.cc                         |  14 +--
 iocore/cache/CacheWrite.cc                       |  58 ++----------
 iocore/cache/I_Cache.h                           |  10 +-
 iocore/cache/P_Cache.h                           |   2 -
 iocore/cache/P_CacheHttp.h                       |   7 --
 iocore/cache/P_CacheInternal.h                   |  48 ++--------
 iocore/cache/P_CacheTest.h                       |   3 -
 iocore/cluster/ClusterCache.cc                   |  14 +--
 iocore/cluster/P_Cluster.h                       |   2 -
 iocore/cluster/P_ClusterCacheInternal.h          |  16 ++--
 iocore/cluster/P_ClusterInline.h                 |  13 +--
 lib/ts/apidefs.h.in                              |   8 ++
 lib/ts/ink_config.h.in                           |   1 -
 mgmt/Makefile.am                                 |   1 +
 mgmt/ProcessManager.cc                           |   1 -
 plugins/experimental/ts_lua/ts_lua_http_config.c |  18 +++-
 proxy/ICP.cc                                     |   7 +-
 proxy/ICP.h                                      |   2 +
 proxy/InkAPI.cc                                  |  80 ++++++++++++++--
 proxy/InkAPITest.cc                              |   8 ++
 proxy/Prefetch.cc                                |  21 +----
 proxy/Prefetch.h                                 |  12 ++-
 proxy/http/HttpCacheSM.cc                        |   8 +-
 proxy/http/HttpCacheSM.h                         |   5 +-
 proxy/http/HttpConfig.cc                         |  54 +++++------
 proxy/http/HttpConfig.h                          |  47 +++++-----
 proxy/http/HttpSM.cc                             |  16 +---
 proxy/http/HttpTransact.h                        |   2 -
 proxy/http/HttpTransactCache.cc                  | 113 ++---------------------
 proxy/http/HttpTransactCache.h                   |  66 ++-----------
 35 files changed, 249 insertions(+), 589 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 02/02: Removes the HTTP_CACHE define, the cache is always enabled now

Posted by zw...@apache.org.
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

commit 487d829121cc491d129676d208449471c2586bae
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Apr 11 17:32:40 2017 -0700

    Removes the HTTP_CACHE define, the cache is always enabled now
---
 cmd/traffic_layout/traffic_layout.cc |  1 -
 iocore/cache/Cache.cc                | 23 +--------
 iocore/cache/CacheHttp.cc            | 98 ------------------------------------
 iocore/cache/CacheRead.cc            | 39 +++-----------
 iocore/cache/CacheVol.cc             | 14 +-----
 iocore/cache/CacheWrite.cc           | 58 +++------------------
 iocore/cache/I_Cache.h               |  6 ---
 iocore/cache/P_Cache.h               |  2 -
 iocore/cache/P_CacheHttp.h           |  7 ---
 iocore/cache/P_CacheInternal.h       | 44 +++-------------
 iocore/cache/P_CacheTest.h           |  2 -
 iocore/cluster/P_Cluster.h           |  2 -
 lib/ts/ink_config.h.in               |  1 -
 mgmt/Makefile.am                     |  1 +
 mgmt/ProcessManager.cc               |  1 -
 15 files changed, 24 insertions(+), 275 deletions(-)

diff --git a/cmd/traffic_layout/traffic_layout.cc b/cmd/traffic_layout/traffic_layout.cc
index 09df95e..82a33c8 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -121,7 +121,6 @@ produce_features(bool json)
   print_feature("TS_MAX_HOST_NAME_LEN", TS_MAX_HOST_NAME_LEN, json);
   print_feature("TS_MAX_API_STATS", TS_MAX_API_STATS, json);
   print_feature("SPLIT_DNS", SPLIT_DNS, json);
-  print_feature("HTTP_CACHE", HTTP_CACHE, json);
   print_feature("TS_PKGSYSUSER", TS_PKGSYSUSER, json);
   print_feature("TS_PKGSYSGROUP", TS_PKGSYSGROUP, json, true);
   if (json) {
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 9fdcf51..5c0271e 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -29,13 +29,11 @@
 
 #include "ts/I_Layout.h"
 
-#ifdef HTTP_CACHE
 #include "HttpTransactCache.h"
 #include "HttpSM.h"
 #include "HttpCacheSM.h"
 #include "InkAPIInternal.h"
 #include "P_CacheBC.h"
-#endif
 
 #include "ts/hugepages.h"
 
@@ -80,12 +78,10 @@ int cache_config_read_while_writer             = 0;
 int cache_config_mutex_retry_delay             = 2;
 int cache_read_while_writer_retry_delay        = 50;
 int cache_config_read_while_writer_max_retries = 10;
-#ifdef HTTP_CACHE
-static int enable_cache_empty_http_doc = 0;
+static int enable_cache_empty_http_doc         = 0;
 /// Fix up a specific known problem with the 4.2.0 release.
 /// Not used for stripes with a cache version later than 4.2.0.
 int cache_config_compatibility_4_2_0_fixup = 1;
-#endif
 
 // Globals
 
@@ -309,14 +305,12 @@ CacheVC::CacheVC() : alternate_index(CACHE_ALT_INDEX_DEFAULT)
   memset((void *)&vio, 0, size_to_init);
 }
 
-#ifdef HTTP_CACHE
 HTTPInfo::FragOffset *
 CacheVC::get_frag_table()
 {
   ink_assert(alternate.valid());
   return alternate.valid() ? alternate.get_frag_table() : nullptr;
 }
-#endif
 
 VIO *
 CacheVC::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *abuf)
@@ -422,11 +416,9 @@ bool
 CacheVC::get_data(int i, void *data)
 {
   switch (i) {
-#ifdef HTTP_CACHE
   case CACHE_DATA_HTTP_INFO:
     *((CacheHTTPInfo **)data) = &alternate;
     return true;
-#endif
   case CACHE_DATA_RAM_CACHE_HIT_FLAG:
     *((int *)data) = !f.not_from_ram_cache;
     return true;
@@ -449,7 +441,6 @@ CacheVC::set_data(int /* i ATS_UNUSED */, void * /* data */)
   return true;
 }
 
-#ifdef HTTP_CACHE
 void
 CacheVC::get_http_info(CacheHTTPInfo **ainfo)
 {
@@ -482,7 +473,6 @@ CacheVC::set_http_info(CacheHTTPInfo *ainfo)
   alternate.copy_shallow(ainfo);
   ainfo->clear();
 }
-#endif
 
 bool
 CacheVC::set_pin_in_cache(time_t time_pin)
@@ -1182,7 +1172,6 @@ scan(Continuation *cont, char *hostname = 0, int host_len = 0, int KB_per_second
 }
 #endif
 
-#ifdef HTTP_CACHE
 Action *
 CacheProcessor::lookup(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, bool local_only,
                        CacheFragType frag_type)
@@ -1190,8 +1179,6 @@ CacheProcessor::lookup(Continuation *cont, const HttpCacheKey *key, bool cluster
   return lookup(cont, &key->hash, cluster_cache_local, local_only, frag_type, key->hostname, key->hostlen);
 }
 
-#endif
-
 #ifdef CLUSTER_CACHE
 Action *
 CacheProcessor::link(Continuation *cont, CacheKey *from, CacheKey *to, bool cluster_cache_local, CacheFragType type, char *hostname,
@@ -2215,7 +2202,6 @@ CacheVC::is_pread_capable()
 
 #define STORE_COLLISION 1
 
-#ifdef HTTP_CACHE
 static void
 unmarshal_helper(Doc *doc, Ptr<IOBufferData> &buf, int &okay)
 {
@@ -2317,7 +2303,6 @@ upgrade_doc_version(Ptr<IOBufferData> &buf)
   }
   return zret;
 }
-#endif
 
 // [amc] I think this is where all disk reads from cache funnel through here.
 int
@@ -2413,14 +2398,12 @@ CacheVC::handleReadDone(int event, Event *e)
       }
       (void)e; // Avoid compiler warnings
       bool http_copy_hdr = false;
-#ifdef HTTP_CACHE
       http_copy_hdr =
         cache_config_ram_cache_compress && !f.doc_from_ram_cache && doc->doc_type == CACHE_FRAG_TYPE_HTTP && doc->hlen;
       // If http doc we need to unmarshal the headers before putting in the ram cache
       // unless it could be compressed
       if (!http_copy_hdr && doc->doc_type == CACHE_FRAG_TYPE_HTTP && doc->hlen && okay)
         unmarshal_helper(doc, buf, okay);
-#endif
       // Put the request in the ram cache only if its a open_read or lookup
       if (vio.op == VIO::READ && okay) {
         bool cutoff_check;
@@ -2445,11 +2428,9 @@ CacheVC::handleReadDone(int event, Event *e)
           vol->first_fragment_data   = buf;
         }
       } // end VIO::READ check
-#ifdef HTTP_CACHE
       // If it could be compressed, unmarshal after
       if (http_copy_hdr && doc->doc_type == CACHE_FRAG_TYPE_HTTP && doc->hlen && okay)
         unmarshal_helper(doc, buf, okay);
-#endif
     } // end io.ok() check
   }
 Ldone:
@@ -3258,11 +3239,9 @@ ink_cache_init(ModuleVersion v)
   if (cache_config_target_fragment_size == 0)
     cache_config_target_fragment_size = DEFAULT_TARGET_FRAGMENT_SIZE;
 
-#ifdef HTTP_CACHE
   REC_EstablishStaticConfigInt32(enable_cache_empty_http_doc, "proxy.config.http.cache.allow_empty_doc");
 
   REC_EstablishStaticConfigInt32(cache_config_compatibility_4_2_0_fixup, "proxy.config.cache.http.compatibility.4-2-0-fixup");
-#endif
 
   REC_EstablishStaticConfigInt32(cache_config_max_disk_errors, "proxy.config.cache.max_disk_errors");
   Debug("cache_init", "proxy.config.cache.max_disk_errors = %d", cache_config_max_disk_errors);
diff --git a/iocore/cache/CacheHttp.cc b/iocore/cache/CacheHttp.cc
index da29ee3..e572d11 100644
--- a/iocore/cache/CacheHttp.cc
+++ b/iocore/cache/CacheHttp.cc
@@ -30,7 +30,6 @@
 
 static vec_info default_vec_info;
 
-#ifdef HTTP_CACHE
 static CacheHTTPInfo default_http_info;
 
 CacheHTTPInfoVector::CacheHTTPInfoVector() : magic(nullptr), data(&default_vec_info, 4), xcount(0)
@@ -248,100 +247,3 @@ CacheHTTPInfoVector::get_handles(const char *buf, int length, RefCountObj *block
 
   return ((caddr_t)buf - (caddr_t)start);
 }
-
-#else // HTTP_CACHE
-
-CacheHTTPInfoVector::CacheHTTPInfoVector() : data(&default_vec_info, 4), xcount(0)
-{
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-CacheHTTPInfoVector::~CacheHTTPInfoVector()
-{
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-int
-CacheHTTPInfoVector::insert(CacheHTTPInfo * /* info ATS_UNUSED */, int index)
-{
-  ink_assert(0);
-  return index;
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-void
-CacheHTTPInfoVector::detach(int /* idx ATS_UNUSED */, CacheHTTPInfo * /* r ATS_UNUSED */)
-{
-  ink_assert(0);
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-void
-CacheHTTPInfoVector::remove(int /* idx ATS_UNUSED */, bool /* destroy ATS_UNUSED */)
-{
-  ink_assert(0);
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-void
-CacheHTTPInfoVector::clear(bool /* destroy ATS_UNUSED */)
-{
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-void
-CacheHTTPInfoVector::print(char * /* buffer ATS_UNUSED */, size_t /* buf_size ATS_UNUSED */, bool /* temps ATS_UNUSED */)
-{
-  ink_assert(0);
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-
-int
-CacheHTTPInfoVector::marshal_length()
-{
-  ink_assert(0);
-  return 0;
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-int
-CacheHTTPInfoVector::marshal(char * /* buf ATS_UNUSED */, int length)
-{
-  ink_assert(0);
-  return length;
-}
-
-int
-CacheHTTPInfoVector::unmarshal(const char * /* buf ATS_UNUSED */, int /* length ATS_UNUSED */,
-                               RefCountObj * /* block_ptr ATS_UNUSED */)
-{
-  ink_assert(0);
-  return 0;
-}
-
-/*-------------------------------------------------------------------------
-  -------------------------------------------------------------------------*/
-uint32_t
-CacheHTTPInfoVector::get_handles(const char * /* buf ATS_UNUSED */, int /* length ATS_UNUSED */,
-                                 RefCountObj * /* block_ptr ATS_UNUSED */)
-{
-  ink_assert(0);
-  return 0;
-}
-
-#endif // HTTP_CACHE
diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index f55e727..d7d0f83 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -23,9 +23,7 @@
 
 #include "P_Cache.h"
 
-#ifdef HTTP_CACHE
 #include "HttpCacheSM.h" //Added to get the scope of HttpCacheSM object.
-#endif
 
 extern int cache_config_compatibility_4_2_0_fixup;
 
@@ -90,7 +88,6 @@ Lcallreturn:
   return &c->_action;
 }
 
-#ifdef HTTP_CACHE
 Action *
 Cache::open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, OverridableHttpConfigParams *params,
                  CacheFragType type, const char *hostname, int host_len)
@@ -159,7 +156,6 @@ Lcallreturn:
     return ACTION_RESULT_DONE;
   return &c->_action;
 }
-#endif
 
 uint32_t
 CacheVC::load_http_info(CacheHTTPInfoVector *info, Doc *doc, RefCountObj *block_ptr)
@@ -209,9 +205,7 @@ CacheVC::openReadChooseWriter(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSE
     if (!w->closed)
       return -err;
     write_vc = w;
-  }
-#ifdef HTTP_CACHE
-  else {
+  } else {
     write_vector      = &od->vector;
     int write_vec_cnt = write_vector->count();
     for (int c = 0; c < write_vec_cnt; c++)
@@ -283,7 +277,6 @@ CacheVC::openReadChooseWriter(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSE
     DDebug("cache_read_agg", "%p: key: %X eKey: %d # alts: %d, ndx: %d, # writers: %d writer: %p", this, first_key.slice32(1),
            write_vc->earliest_key.slice32(1), vector.count(), alternate_index, od->num_writers, write_vc);
   }
-#endif // HTTP_CACHE
   return EVENT_NONE;
 }
 
@@ -349,10 +342,8 @@ CacheVC::openReadFromWriter(int event, Event *e)
       return openReadStartHead(event, e);
     }
   }
-#ifdef HTTP_CACHE
   OpenDirEntry *cod = od;
-#endif
-  od = nullptr;
+  od                = nullptr;
   // someone is currently writing the document
   if (write_vc->closed < 0) {
     MUTEX_RELEASE(lock);
@@ -383,7 +374,6 @@ CacheVC::openReadFromWriter(int event, Event *e)
 
   if (!write_vc->io.ok())
     return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *)-err);
-#ifdef HTTP_CACHE
   if (frag_type == CACHE_FRAG_TYPE_HTTP) {
     DDebug("cache_read_agg", "%p: key: %X http passed stage 1, closed: %d, frag: %d", this, first_key.slice32(1), write_vc->closed,
            write_vc->fragment);
@@ -432,12 +422,9 @@ CacheVC::openReadFromWriter(int event, Event *e)
       return openReadStartEarliest(event, e);
     }
   } else {
-#endif // HTTP_CACHE
     DDebug("cache_read_agg", "%p: key: %X non-http passed stage 1", this, first_key.slice32(1));
     key = write_vc->earliest_key;
-#ifdef HTTP_CACHE
   }
-#endif
   if (write_vc->fragment) {
     doc_len        = write_vc->vio.nbytes;
     last_collision = nullptr;
@@ -626,7 +613,6 @@ CacheVC::openReadMain(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
       vio.ndone = doc_len;
       return calluser(VC_EVENT_EOS);
     }
-#ifdef HTTP_CACHE
     HTTPInfo::FragOffset *frags = alternate.get_frag_table();
     if (is_debug_tag_set("cache_seek")) {
       char b[33], c[33];
@@ -693,7 +679,6 @@ CacheVC::openReadMain(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
       key.toHexStr(target_key_str);
       Debug("cache_seek", "Read # %d @ %" PRId64 "/%d for %" PRId64, fragment, doc_pos, doc->len, bytes);
     }
-#endif
   }
   if (ntodo <= 0)
     return EVENT_CONT;
@@ -842,9 +827,8 @@ CacheVC::openReadStartEarliest(int /* event ATS_UNUSED */, Event * /* e ATS_UNUS
         goto Lcallreturn;
       return ret;
     }
-// read has detected that alternate does not exist in the cache.
-// rewrite the vector.
-#ifdef HTTP_CACHE
+    // read has detected that alternate does not exist in the cache.
+    // rewrite the vector.
     if (!f.read_from_writer_called && frag_type == CACHE_FRAG_TYPE_HTTP) {
       // don't want any writers while we are evacuating the vector
       if (!vol->open_write(this, false, 1)) {
@@ -896,7 +880,6 @@ CacheVC::openReadStartEarliest(int /* event ATS_UNUSED */, Event * /* e ATS_UNUS
         }
       }
     }
-#endif
   // open write failure - another writer, so don't modify the vector
   Ldone:
     if (od)
@@ -916,7 +899,6 @@ Lsuccess:
 
 // create the directory entry after the vector has been evacuated
 // the volume lock has been taken when this function is called
-#ifdef HTTP_CACHE
 int
 CacheVC::openReadVecWrite(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
 {
@@ -964,7 +946,6 @@ Lrestart:
   SET_HANDLER(&CacheVC::openReadStartHead);
   return openReadStartHead(EVENT_IMMEDIATE, nullptr);
 }
-#endif
 
 /*
   This code follows CacheVC::openReadStartEarliest closely,
@@ -1019,7 +1000,6 @@ CacheVC::openReadStartHead(int event, Event *e)
     if (f.lookup)
       goto Lookup;
     earliest_dir = dir;
-#ifdef HTTP_CACHE
     CacheHTTPInfo *alternate_tmp;
     if (frag_type == CACHE_FRAG_TYPE_HTTP) {
       uint32_t uml;
@@ -1080,9 +1060,7 @@ CacheVC::openReadStartHead(int event, Event *e)
       } else {
         f.single_fragment = false;
       }
-    } else
-#endif
-    {
+    } else {
       next_CacheKey(&key, &doc->key);
       f.single_fragment = doc->single_fragment();
       doc_pos           = doc->prefix_len();
@@ -1093,12 +1071,7 @@ CacheVC::openReadStartHead(int event, Event *e)
       char xt[33], yt[33];
       Debug("cache_read", "CacheReadStartHead - read %s target %s - %s %d of %" PRId64 " bytes, %d fragments",
             doc->key.toHexStr(xt), key.toHexStr(yt), f.single_fragment ? "single" : "multi", doc->len, doc->total_len,
-#ifdef HTTP_CACHE
-            alternate.get_frag_offset_count()
-#else
-            0
-#endif
-              );
+            alternate.get_frag_offset_count());
     }
     // the first fragment might have been gc'ed. Make sure the first
     // fragment is there before returning CACHE_EVENT_OPEN_READ
diff --git a/iocore/cache/CacheVol.cc b/iocore/cache/CacheVol.cc
index ce641c8..b1b7a4d 100644
--- a/iocore/cache/CacheVol.cc
+++ b/iocore/cache/CacheVol.cc
@@ -156,11 +156,9 @@ CacheVC::scanObject(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
 
   Doc *doc     = nullptr;
   void *result = nullptr;
-#ifdef HTTP_CACHE
-  int hlen = 0;
+  int hlen     = 0;
   char hname[500];
-  bool hostinfo_copied = false;
-#endif
+  bool hostinfo_copied         = false;
   off_t next_object_len        = 0;
   bool might_need_overlap_read = false;
 
@@ -209,7 +207,6 @@ CacheVC::scanObject(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
     might_need_overlap_read = false;
     doc                     = (Doc *)((char *)doc + next_object_len);
     next_object_len         = vol->round_to_approx_size(doc->len);
-#ifdef HTTP_CACHE
     int i;
     bool changed;
 
@@ -321,11 +318,8 @@ CacheVC::scanObject(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
     }
     continue;
   Lskip:;
-#endif
   }
-#ifdef HTTP_CACHE
   vector.clear();
-#endif
   // If we had an object that went past the end of the buffer, and it is small enough to fix,
   // fix it.
   if (might_need_overlap_read && ((off_t)((char *)doc - buf->data()) + next_object_len > (off_t)io.aiocb.aio_nbytes) &&
@@ -366,9 +360,7 @@ Lread:
 Ldone:
   Debug("cache_scan_truss", "done %p:scanObject", this);
   _action.continuation->handleEvent(CACHE_EVENT_SCAN_DONE, result);
-#ifdef HTTP_CACHE
 Lcancel:
-#endif
   return free_CacheVC(this);
 }
 
@@ -377,9 +369,7 @@ CacheVC::scanRemoveDone(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
 {
   Debug("cache_scan_truss", "inside %p:scanRemoveDone", this);
   Debug("cache_scan", "remove done.");
-#ifdef HTTP_CACHE
   alternate.destroy();
-#endif
   SET_HANDLER(&CacheVC::scanObject);
   return handleEvent(EVENT_IMMEDIATE, nullptr);
 }
diff --git a/iocore/cache/CacheWrite.cc b/iocore/cache/CacheWrite.cc
index 7b6d082..18012c6 100644
--- a/iocore/cache/CacheWrite.cc
+++ b/iocore/cache/CacheWrite.cc
@@ -30,7 +30,6 @@
 
 // Given a key, finds the index of the alternate which matches
 // used to get the alternate which is actually present in the document
-#ifdef HTTP_CACHE
 int
 get_alternate_index(CacheHTTPInfoVector *cache_vector, CacheKey key)
 {
@@ -139,7 +138,6 @@ CacheVC::updateVector(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
     return handleEvent(AIO_EVENT_DONE, nullptr);
   return ret;
 }
-#endif
 /*
    The following fields of the CacheVC are used when writing down a fragment.
    Make sure that each of the fields is set to a valid value before calling
@@ -381,10 +379,8 @@ CacheVC::evacuateReadHead(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */
   // The evacuator vc shares the lock with the volition mutex
   ink_assert(vol->mutex->thread_holding == this_ethread());
   cancel_trigger();
-  Doc *doc = (Doc *)buf->data();
-#ifdef HTTP_CACHE
+  Doc *doc                     = (Doc *)buf->data();
   CacheHTTPInfo *alternate_tmp = nullptr;
-#endif
   if (!io.ok())
     goto Ldone;
   // a directory entry which is nolonger valid may have been overwritten
@@ -394,7 +390,6 @@ CacheVC::evacuateReadHead(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */
   }
   if (doc->magic != DOC_MAGIC || !(doc->first_key == first_key))
     goto Lcollision;
-#ifdef HTTP_CACHE
   alternate_tmp = nullptr;
   if (doc->doc_type == CACHE_FRAG_TYPE_HTTP && doc->hlen) {
     // its an http document
@@ -409,9 +404,7 @@ CacheVC::evacuateReadHead(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */
     doc_len       = alternate_tmp->object_size_get();
     Debug("cache_evac", "evacuateReadHead http earliest %X first: %X len: %" PRId64, first_key.slice32(0), earliest_key.slice32(0),
           doc_len);
-  } else
-#endif
-  {
+  } else {
     // non-http document
     CacheKey next_key;
     next_CacheKey(&next_key, &doc->key);
@@ -750,11 +743,7 @@ agg_copy(char *p, CacheVC *vc)
     }
 
     if (vc->f.use_first_key) {
-      if (doc->data_len()
-#ifdef HTTP_CACHE
-          || vc->f.allow_empty_doc
-#endif
-          )
+      if (doc->data_len() || vc->f.allow_empty_doc)
         doc->key = vc->earliest_key;
       else // the vector is being written by itself
         prev_CacheKey(&doc->key, &vc->earliest_key);
@@ -764,7 +753,6 @@ agg_copy(char *p, CacheVC *vc)
       dir_set_head(&vc->dir, !vc->fragment);
     }
 
-#ifdef HTTP_CACHE
     if (vc->f.rewrite_resident_alt) {
       ink_assert(vc->f.use_first_key);
       Doc *res_doc   = (Doc *)vc->first_buf->data();
@@ -772,11 +760,9 @@ agg_copy(char *p, CacheVC *vc)
       doc->key       = res_doc->key;
       doc->total_len = res_doc->data_len();
     }
-#endif
     // update the new_info object_key, and total_len and dirinfo
     if (vc->header_len) {
       ink_assert(vc->f.use_first_key);
-#ifdef HTTP_CACHE
       if (vc->frag_type == CACHE_FRAG_TYPE_HTTP) {
         ink_assert(vc->write_vector->count() > 0);
         if (!vc->f.update && !vc->f.evac_vector) {
@@ -793,7 +779,6 @@ agg_copy(char *p, CacheVC *vc)
         ink_assert(!(((uintptr_t)&doc->hdr()[0]) & HDR_PTR_ALIGNMENT_MASK));
         ink_assert(vc->header_len == vc->write_vector->marshal(doc->hdr(), vc->header_len));
       } else
-#endif
         memcpy(doc->hdr(), vc->header_to_write, vc->header_len);
       // the single fragment flag is not used in the write call.
       // putting it in for completeness.
@@ -806,11 +791,9 @@ agg_copy(char *p, CacheVC *vc)
         ink_assert(mutex->thread_holding == this_ethread());
         CACHE_DEBUG_SUM_DYN_STAT(cache_write_bytes_stat, vc->write_len);
       }
-#ifdef HTTP_CACHE
       if (vc->f.rewrite_resident_alt)
         iobufferblock_memcpy(doc->data(), vc->write_len, res_alt_blk, 0);
       else
-#endif
         iobufferblock_memcpy(doc->data(), vc->write_len, vc->blocks.get(), vc->offset);
 #ifdef VERIFY_JTEST_DATA
       if (f.use_first_key && header_len) {
@@ -1091,11 +1074,7 @@ CacheVC::openWriteCloseDir(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED *
   // one, two and three or more fragments. This is because for
   // updates we dont decrement the variable corresponding the old
   // size of the document
-  if ((closed == 1) && (total_len > 0
-#ifdef HTTP_CACHE
-                        || f.allow_empty_doc
-#endif
-                        )) {
+  if ((closed == 1) && (total_len > 0 || f.allow_empty_doc)) {
     DDebug("cache_stats", "Fragment = %d", fragment);
     switch (fragment) {
     case 0:
@@ -1175,18 +1154,14 @@ CacheVC::openWriteCloseHead(int event, Event *e)
     write_len = 0;
   else
     write_len = length;
-#ifdef HTTP_CACHE
   if (frag_type == CACHE_FRAG_TYPE_HTTP) {
     SET_HANDLER(&CacheVC::updateVector);
     return updateVector(EVENT_IMMEDIATE, nullptr);
   } else {
-#endif
     header_len = header_to_write_len;
     SET_HANDLER(&CacheVC::openWriteCloseHeadDone);
     return do_write_lock();
-#ifdef HTTP_CACHE
   }
-#endif
 }
 
 int
@@ -1208,13 +1183,11 @@ CacheVC::openWriteCloseDataDone(int event, Event *e)
     if (!fragment) {
       ink_assert(key == earliest_key);
       earliest_dir = dir;
-#ifdef HTTP_CACHE
     } else {
       // Store the offset only if there is a table.
       // Currently there is no alt (and thence no table) for non-HTTP.
       if (alternate.valid())
         alternate.push_frag_offset(write_pos);
-#endif
     }
     fragment++;
     write_pos += write_len;
@@ -1247,13 +1220,8 @@ CacheVC::openWriteClose(int event, Event *e)
     if (!io.ok())
       return openWriteCloseDir(event, e);
   }
-  if (closed > 0
-#ifdef HTTP_CACHE
-      || f.allow_empty_doc
-#endif
-      ) {
+  if (closed > 0 || f.allow_empty_doc) {
     if (total_len == 0) {
-#ifdef HTTP_CACHE
       if (f.update || f.allow_empty_doc) {
         return updateVector(event, e);
       } else {
@@ -1262,9 +1230,6 @@ CacheVC::openWriteClose(int event, Event *e)
         closed = -1;
         return openWriteCloseDir(event, e);
       }
-#else
-      return openWriteCloseDir(event, e);
-#endif
     }
     if (length && (fragment || length > MAX_FRAG_SIZE)) {
       SET_HANDLER(&CacheVC::openWriteCloseDataDone);
@@ -1304,13 +1269,11 @@ CacheVC::openWriteWriteDone(int event, Event *e)
     if (!fragment) {
       ink_assert(key == earliest_key);
       earliest_dir = dir;
-#ifdef HTTP_CACHE
     } else {
       // Store the offset only if there is a table.
       // Currently there is no alt (and thence no table) for non-HTTP.
       if (alternate.valid())
         alternate.push_frag_offset(write_pos);
-#endif
     }
     ++fragment;
     write_pos += write_len;
@@ -1439,7 +1402,6 @@ Lcallreturn:
   return handleEvent(AIO_EVENT_DONE, nullptr); // hopefully a tail call
 }
 
-#ifdef HTTP_CACHE
 // openWriteStartDone handles vector read (addition of alternates)
 // and lock misses
 int
@@ -1542,7 +1504,6 @@ Lcancel:
 Lcallreturn:
   return handleEvent(AIO_EVENT_DONE, nullptr); // hopefully a tail call
 }
-#endif
 
 // handle lock failures from main Cache::open_write entry points below
 int
@@ -1603,10 +1564,8 @@ Cache::open_write(Continuation *cont, const CacheKey *key, CacheFragType frag_ty
   do {
     rand_CacheKey(&c->key, cont->mutex);
   } while (DIR_MASK_TAG(c->key.slice32(2)) == DIR_MASK_TAG(c->first_key.slice32(2)));
-  c->earliest_key = c->key;
-#ifdef HTTP_CACHE
-  c->info = nullptr;
-#endif
+  c->earliest_key     = c->key;
+  c->info             = nullptr;
   c->f.overwrite      = (options & CACHE_WRITE_OPT_OVERWRITE) != 0;
   c->f.close_complete = (options & CACHE_WRITE_OPT_CLOSE_COMPLETE) != 0;
   c->f.sync           = (options & CACHE_WRITE_OPT_SYNC) == CACHE_WRITE_OPT_SYNC;
@@ -1637,7 +1596,6 @@ Cache::open_write(Continuation *cont, const CacheKey *key, CacheFragType frag_ty
   }
 }
 
-#ifdef HTTP_CACHE
 // main entry point for writing of http documents
 Action *
 Cache::open_write(Continuation *cont, const CacheKey *key, CacheHTTPInfo *info, time_t apin_in_cache,
@@ -1770,5 +1728,3 @@ Lcallreturn:
     return ACTION_RESULT_DONE;
   return &c->_action;
 }
-
-#endif
diff --git a/iocore/cache/I_Cache.h b/iocore/cache/I_Cache.h
index 76fad29..ac140a4 100644
--- a/iocore/cache/I_Cache.h
+++ b/iocore/cache/I_Cache.h
@@ -53,7 +53,6 @@ enum { RAM_HIT_COMPRESS_NONE = 1, RAM_HIT_COMPRESS_FASTLZ, RAM_HIT_COMPRESS_LIBZ
 
 struct CacheVC;
 struct CacheDisk;
-#ifdef HTTP_CACHE
 struct OverridableHttpConfigParams;
 class URL;
 class HTTPHdr;
@@ -62,7 +61,6 @@ class HTTPInfo;
 typedef HTTPHdr CacheHTTPHdr;
 typedef URL CacheURL;
 typedef HTTPInfo CacheHTTPInfo;
-#endif
 
 struct CacheProcessor : public Processor {
   CacheProcessor()
@@ -90,7 +88,6 @@ struct CacheProcessor : public Processor {
   inkcoreapi Action *remove(Continuation *cont, const CacheKey *key, bool cluster_cache_local,
                             CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, const char *hostname = 0, int host_len = 0);
   Action *scan(Continuation *cont, char *hostname = 0, int host_len = 0, int KB_per_second = SCAN_KB_PER_SECOND);
-#ifdef HTTP_CACHE
   Action *lookup(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, bool local_only = false,
                  CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
   inkcoreapi Action *open_read(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, CacheHTTPHdr *request,
@@ -101,7 +98,6 @@ struct CacheProcessor : public Processor {
                      CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
   Action *remove(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local,
                  CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-#endif
   Action *link(Continuation *cont, CacheKey *from, CacheKey *to, bool cluster_cache_local,
                CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
 
@@ -197,10 +193,8 @@ struct CacheVConnection : public VConnection {
   virtual int set_header(void *ptr, int len)        = 0;
   virtual int get_single_data(void **ptr, int *len) = 0;
 
-#ifdef HTTP_CACHE
   virtual void set_http_info(CacheHTTPInfo *info)  = 0;
   virtual void get_http_info(CacheHTTPInfo **info) = 0;
-#endif
 
   virtual bool is_ram_cache_hit() const           = 0;
   virtual bool set_disk_io_priority(int priority) = 0;
diff --git a/iocore/cache/P_Cache.h b/iocore/cache/P_Cache.h
index 03f34ac..e7f39f1 100644
--- a/iocore/cache/P_Cache.h
+++ b/iocore/cache/P_Cache.h
@@ -29,11 +29,9 @@
 #include "P_AIO.h"
 #include "I_RecProcess.h"
 
-#ifdef HTTP_CACHE
 #include "HTTP.h"
 #include "MIME.h"
 #include "HttpTransactCache.h"
-#endif
 
 #include "I_Cache.h"
 #include "P_CacheDisk.h"
diff --git a/iocore/cache/P_CacheHttp.h b/iocore/cache/P_CacheHttp.h
index 1958c74..09408b9 100644
--- a/iocore/cache/P_CacheHttp.h
+++ b/iocore/cache/P_CacheHttp.h
@@ -25,7 +25,6 @@
 #define __CACHE_HTTP_H__
 
 #include "P_CacheArray.h"
-#ifdef HTTP_CACHE
 #include "HTTP.h"
 #include "URL.h"
 
@@ -40,12 +39,6 @@ enum {
   OWNER_HTTP  = 2,
 };
 
-#else
-struct CacheHTTPInfo {
-};
-
-#endif // HTTP_CACHE
-
 struct vec_info {
   CacheHTTPInfo alternate;
 };
diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index 09ed81e..2d852bc 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -27,10 +27,8 @@
 #include "ts/ink_platform.h"
 #include "ts/InkErrno.h"
 
-#ifdef HTTP_CACHE
 #include "HTTP.h"
 #include "P_CacheHttp.h"
-#endif
 
 struct EvacuationBlock;
 
@@ -316,9 +314,7 @@ struct CacheVC : public CacheVConnection {
   int openReadReadDone(int event, Event *e);
   int openReadMain(int event, Event *e);
   int openReadStartEarliest(int event, Event *e);
-#ifdef HTTP_CACHE
   int openReadVecWrite(int event, Event *e);
-#endif
   int openReadStartHead(int event, Event *e);
   int openReadFromWriter(int event, Event *e);
   int openReadFromWriterMain(int event, Event *e);
@@ -372,7 +368,6 @@ struct CacheVC : public CacheVConnection {
 
   void cancel_trigger();
   virtual int64_t get_object_size();
-#ifdef HTTP_CACHE
   virtual void set_http_info(CacheHTTPInfo *info);
   virtual void get_http_info(CacheHTTPInfo **info);
   /** Get the fragment table.
@@ -384,7 +379,6 @@ struct CacheVC : public CacheVConnection {
       @return Length of header data used for alternates.
    */
   virtual uint32_t load_http_info(CacheHTTPInfoVector *info, struct Doc *doc, RefCountObj *block_ptr = nullptr);
-#endif
   virtual bool is_pread_capable();
   virtual bool set_pin_in_cache(time_t time_pin);
   virtual time_t get_pin_in_cache();
@@ -415,9 +409,7 @@ struct CacheVC : public CacheVConnection {
   // CacheVC is freed. All these variables must be reset/cleared
   // in free_CacheVC.
   Action _action;
-#ifdef HTTP_CACHE
   CacheHTTPHdr request;
-#endif
   CacheHTTPInfoVector vector;
   CacheHTTPInfo alternate;
   Ptr<IOBufferData> buf;
@@ -446,9 +438,7 @@ struct CacheVC : public CacheVConnection {
   CacheFragType frag_type;
   CacheHTTPInfo *info;
   CacheHTTPInfoVector *write_vector;
-#ifdef HTTP_CACHE
   OverridableHttpConfigParams *params;
-#endif
   int header_len;        // for communicating with agg_copy
   int frag_len;          // for communicating with agg_copy
   uint32_t write_len;    // for communicating with agg_copy
@@ -504,9 +494,7 @@ struct CacheVC : public CacheVConnection {
       unsigned int doc_from_ram_cache : 1;
       unsigned int hit_evacuate : 1;
       unsigned int compressed_in_ram : 1; // compressed state in ram cache
-#ifdef HTTP_CACHE
-      unsigned int allow_empty_doc : 1; // used for cache empty http document
-#endif
+      unsigned int allow_empty_doc : 1;   // used for cache empty http document
     } f;
   };
   // BTF optimization used to skip reading stuff in cache partition that doesn't contain any
@@ -542,10 +530,8 @@ extern ClassAllocator<CacheVC> cacheVConnectionAllocator;
 extern CacheKey zero_key;
 extern CacheSync *cacheDirSync;
 // Function Prototypes
-#ifdef HTTP_CACHE
 int cache_write(CacheVC *, CacheHTTPInfoVector *);
 int get_alternate_index(CacheHTTPInfoVector *cache_vector, CacheKey key);
-#endif
 CacheVC *new_DocEvacuator(int nbytes, Vol *d);
 
 // inline Functions
@@ -553,15 +539,13 @@ CacheVC *new_DocEvacuator(int nbytes, Vol *d);
 TS_INLINE CacheVC *
 new_CacheVC(Continuation *cont)
 {
-  EThread *t = cont->mutex->thread_holding;
-  CacheVC *c = THREAD_ALLOC(cacheVConnectionAllocator, t);
-#ifdef HTTP_CACHE
+  EThread *t          = cont->mutex->thread_holding;
+  CacheVC *c          = THREAD_ALLOC(cacheVConnectionAllocator, t);
   c->vector.data.data = &c->vector.data.fast_data[0];
-#endif
-  c->_action        = cont;
-  c->initial_thread = t->tt == DEDICATED ? nullptr : t;
-  c->mutex          = cont->mutex;
-  c->start_time     = Thread::get_hrtime();
+  c->_action          = cont;
+  c->initial_thread   = t->tt == DEDICATED ? nullptr : t;
+  c->mutex            = cont->mutex;
+  c->start_time       = Thread::get_hrtime();
   ink_assert(c->trigger == nullptr);
   Debug("cache_new", "new %p", c);
 #ifdef CACHE_STAT_PAGES
@@ -598,18 +582,14 @@ free_CacheVC(CacheVC *cont)
   cont->io.aio_result        = 0;
   cont->io.aiocb.aio_nbytes  = 0;
   cont->io.aiocb.aio_reqprio = AIO_DEFAULT_PRIORITY;
-#ifdef HTTP_CACHE
   cont->request.reset();
   cont->vector.clear();
-#endif
   cont->vio.buffer.clear();
   cont->vio.mutex.clear();
-#ifdef HTTP_CACHE
   if (cont->vio.op == VIO::WRITE && cont->alternate_index == CACHE_ALT_INDEX_DEFAULT)
     cont->alternate.destroy();
   else
     cont->alternate.clear();
-#endif
   cont->_action.cancelled = 0;
   cont->_action.mutex.clear();
   cont->mutex.clear();
@@ -689,11 +669,9 @@ TS_INLINE int
 CacheVC::die()
 {
   if (vio.op == VIO::WRITE) {
-#ifdef HTTP_CACHE
     if (f.update && total_len) {
       alternate.object_key_set(earliest_key);
     }
-#endif
     if (!is_io_in_progress()) {
       SET_HANDLER(&CacheVC::openWriteClose);
       if (!recursive)
@@ -987,7 +965,6 @@ struct Cache {
                             const char *hostname = 0, int host_len = 0);
   Action *scan(Continuation *cont, const char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
 
-#ifdef HTTP_CACHE
   Action *open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, OverridableHttpConfigParams *params,
                     CacheFragType type, const char *hostname, int host_len);
   Action *open_write(Continuation *cont, const CacheKey *key, CacheHTTPInfo *old_info, time_t pin_in_cache = (time_t)0,
@@ -995,7 +972,6 @@ struct Cache {
                      int host_len = 0);
   static void generate_key(INK_MD5 *md5, CacheURL *url);
   static void generate_key(HttpCacheKey *md5, CacheURL *url, cache_generation_t generation = -1);
-#endif
 
   Action *link(Continuation *cont, const CacheKey *from, const CacheKey *to, CacheFragType type, const char *hostname,
                int host_len);
@@ -1024,8 +1000,6 @@ extern Cache *theCache;
 extern Cache *theStreamCache;
 inkcoreapi extern Cache *caches[NUM_CACHE_FRAG_TYPES];
 
-#ifdef HTTP_CACHE
-
 TS_INLINE void
 Cache::generate_key(INK_MD5 *md5, CacheURL *url)
 {
@@ -1039,8 +1013,6 @@ Cache::generate_key(HttpCacheKey *key, CacheURL *url, cache_generation_t generat
   url->hash_get(&key->hash, generation);
 }
 
-#endif
-
 TS_INLINE unsigned int
 cache_hash(const INK_MD5 &md5)
 {
@@ -1049,9 +1021,7 @@ cache_hash(const INK_MD5 &md5)
   return mhash;
 }
 
-#ifdef HTTP_CACHE
 #define CLUSTER_CACHE
-#endif
 
 #ifdef CLUSTER_CACHE
 #include "P_Net.h"
diff --git a/iocore/cache/P_CacheTest.h b/iocore/cache/P_CacheTest.h
index 196b093..336c533 100644
--- a/iocore/cache/P_CacheTest.h
+++ b/iocore/cache/P_CacheTest.h
@@ -75,10 +75,8 @@ struct CacheTestSM : public RegressionSM {
   VIO *cvio;
   MIOBuffer *buffer;
   IOBufferReader *buffer_reader;
-#ifdef HTTP_CACHE
   CacheHTTPInfo info;
   char urlstr[1024];
-#endif
   int64_t total_size;
   int64_t nbytes;
   CacheKey key;
diff --git a/iocore/cluster/P_Cluster.h b/iocore/cluster/P_Cluster.h
index 4bd0b72..4c64344 100644
--- a/iocore/cluster/P_Cluster.h
+++ b/iocore/cluster/P_Cluster.h
@@ -30,11 +30,9 @@
 #include "P_Net.h"
 #include "P_Cache.h"
 
-#ifdef HTTP_CACHE
 #include "MIME.h"
 #include "HTTP.h"
 // #include "HttpTransactCache.h"
-#endif
 
 #include "P_ClusterMachine.h"
 #include "P_ClusterCache.h"
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index abc6b6c..b96692f 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -97,7 +97,6 @@
 #define TS_MAX_API_STATS @max_api_stats@
 
 #define SPLIT_DNS 1
-#define HTTP_CACHE 1
 
 /* Defaults for user / group */
 #define TS_PKGSYSUSER "@pkgsysuser@"
diff --git a/mgmt/Makefile.am b/mgmt/Makefile.am
index 25464a9..8f05078 100644
--- a/mgmt/Makefile.am
+++ b/mgmt/Makefile.am
@@ -31,6 +31,7 @@ AM_CPPFLAGS += \
   -I$(abs_top_srcdir)/mgmt/cluster \
   -I$(abs_top_srcdir)/mgmt/utils \
   -I$(abs_top_srcdir)/proxy \
+  -I$(abs_top_srcdir)/proxy/http \
   -I$(abs_top_srcdir)/proxy/hdrs \
   -I$(abs_top_srcdir)/lib/records \
   -I$(abs_top_srcdir)/lib
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index cd7c714..2fabf7d 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -23,7 +23,6 @@
 
 #include "ts/ink_platform.h"
 
-#undef HTTP_CACHE
 #include "InkAPIInternal.h"
 #include "MgmtUtils.h"
 #include "ProcessManager.h"

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 01/02: Eliminates CacheLookupHttpConfig (clustering communications)

Posted by zw...@apache.org.
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

commit c0c1c1bfb7a668078e09c068121b831407e7cc4d
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Apr 11 12:58:43 2017 -0700

    Eliminates CacheLookupHttpConfig (clustering communications)
    
    Instead, we pass along the HttpSM's OverridableHttpConfigParams, which
    allows for more, and more interesting, configurations to be passed into
    the cache SM. This could in the future (with more changes of course)
    allow us to move some of the cache specific configs into the HttpConfig.
    
    This does make 8 more configurations overidable (as needed because of
    how the code worked before).
---
 doc/admin-guide/files/records.config.en.rst      |   8 ++
 iocore/cache/Cache.cc                            |   8 +-
 iocore/cache/CacheRead.cc                        |   4 +-
 iocore/cache/I_Cache.h                           |   4 +-
 iocore/cache/P_CacheInternal.h                   |   4 +-
 iocore/cache/P_CacheTest.h                       |   1 -
 iocore/cluster/ClusterCache.cc                   |  14 +--
 iocore/cluster/P_ClusterCacheInternal.h          |  16 ++--
 iocore/cluster/P_ClusterInline.h                 |  13 +--
 lib/ts/apidefs.h.in                              |   8 ++
 plugins/experimental/ts_lua/ts_lua_http_config.c |  18 +++-
 proxy/ICP.cc                                     |   7 +-
 proxy/ICP.h                                      |   2 +
 proxy/InkAPI.cc                                  |  80 ++++++++++++++--
 proxy/InkAPITest.cc                              |   8 ++
 proxy/Prefetch.cc                                |  21 +----
 proxy/Prefetch.h                                 |  12 ++-
 proxy/http/HttpCacheSM.cc                        |   8 +-
 proxy/http/HttpCacheSM.h                         |   5 +-
 proxy/http/HttpConfig.cc                         |  54 +++++------
 proxy/http/HttpConfig.h                          |  47 +++++-----
 proxy/http/HttpSM.cc                             |  16 +---
 proxy/http/HttpTransact.h                        |   2 -
 proxy/http/HttpTransactCache.cc                  | 113 ++---------------------
 proxy/http/HttpTransactCache.h                   |  66 ++-----------
 25 files changed, 225 insertions(+), 314 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 482d7e4..1b650e8 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1872,6 +1872,7 @@ Cache Control
 
 .. 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.
 
@@ -1934,6 +1935,7 @@ Cache Control
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_mismatch INT 2
    :reloadable:
+   :overridable:
 
    When enabled with a value of ``1``, Traffic Server serves documents from cache with a
    ``Content-Type:`` header even if it does not match the ``Accept:`` header of the
@@ -1950,6 +1952,7 @@ Cache Control
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_language_mismatch INT 2
    :reloadable:
+   :overridable:
 
    When enabled with a value of ``1``, Traffic Server serves documents from cache with a
    ``Content-Language:`` header even if it does not match the ``Accept-Language:``
@@ -1966,6 +1969,7 @@ Cache Control
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_encoding_mismatch INT 2
    :reloadable:
+   :overridable:
 
    When enabled with a value of ``1``, Traffic Server serves documents from cache with a
    ``Content-Encoding:`` header even if it does not match the ``Accept-Encoding:``
@@ -1982,6 +1986,7 @@ Cache Control
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_charset_mismatch INT 2
    :reloadable:
+   :overridable:
 
    When enabled with a value of ``1``, Traffic Server serves documents from cache with a
    ``Content-Type:`` header even if it does not match the ``Accept-Charset:`` header
@@ -2207,6 +2212,7 @@ Dynamic Content & Content Negotiation
 
 .. ts:cv:: CONFIG proxy.config.http.cache.vary_default_text STRING NULL
    :reloadable:
+   :overridable:
 
    The header on which Traffic Server varies for text documents.
 
@@ -2215,11 +2221,13 @@ 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 Traffic Server varies for images.
 
 .. ts:cv:: CONFIG proxy.config.http.cache.vary_default_other STRING NULL
    :reloadable:
+   :overridable:
 
    The header on which Traffic Server varies for anything other than text and images.
 
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 4e75c32..9fdcf51 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -255,12 +255,12 @@ cache_stats_bytes_used_cb(const char *name, RecDataT data_type, RecData *data, R
 #ifdef CLUSTER_CACHE
 static Action *
 open_read_internal(int opcode, Continuation *cont, MIOBuffer *buf, const HttpCacheKey *key, CacheHTTPHdr *request,
-                   CacheLookupHttpConfig *params, time_t pin_in_cache, CacheFragType frag_type)
+                   OverridableHttpConfigParams *params, time_t pin_in_cache, CacheFragType frag_type)
 {
   ClusterMachine *m = cluster_machine_at_depth(cache_hash(key->hash));
 
   if (m) {
-    return Cluster_read(m, opcode, cont, buf, request, params, &key->hash, pin_in_cache, frag_type, key->hostname, key->hostlen);
+    return Cluster_read(m, opcode, cont, buf, request, &key->hash, pin_in_cache, frag_type, key->hostname, key->hostlen);
   } else {
     if ((opcode == CACHE_OPEN_READ_LONG) || (opcode == CACHE_OPEN_READ_BUFFER_LONG)) {
       return caches[frag_type]->open_read(cont, &key->hash, request, params, frag_type, key->hostname, key->hostlen);
@@ -1136,7 +1136,7 @@ CacheProcessor::open_read(Continuation *cont, const CacheKey *key, bool cluster_
     hkey.hostname = hostname;
     hkey.hostlen  = hostlen;
     return open_read_internal(CACHE_OPEN_READ, cont, (MIOBuffer *)nullptr, &hkey, (CacheHTTPHdr *)nullptr,
-                              (CacheLookupHttpConfig *)nullptr, 0, frag_type);
+                              (OverridableHttpConfigParams *)nullptr, 0, frag_type);
   }
 #endif
   return caches[frag_type]->open_read(cont, key, frag_type, hostname, hostlen);
@@ -3294,7 +3294,7 @@ ink_cache_init(ModuleVersion v)
 //----------------------------------------------------------------------------
 Action *
 CacheProcessor::open_read(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, CacheHTTPHdr *request,
-                          CacheLookupHttpConfig *params, time_t pin_in_cache, CacheFragType type)
+                          OverridableHttpConfigParams *params, time_t pin_in_cache, CacheFragType type)
 {
 #ifdef CLUSTER_CACHE
   if (cache_clustering_enabled > 0 && !cluster_cache_local) {
diff --git a/iocore/cache/CacheRead.cc b/iocore/cache/CacheRead.cc
index a9986bd..f55e727 100644
--- a/iocore/cache/CacheRead.cc
+++ b/iocore/cache/CacheRead.cc
@@ -92,8 +92,8 @@ Lcallreturn:
 
 #ifdef HTTP_CACHE
 Action *
-Cache::open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, CacheLookupHttpConfig *params, CacheFragType type,
-                 const char *hostname, int host_len)
+Cache::open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, OverridableHttpConfigParams *params,
+                 CacheFragType type, const char *hostname, int host_len)
 {
   if (!CacheProcessor::IsCacheReady(type)) {
     cont->handleEvent(CACHE_EVENT_OPEN_READ_FAILED, (void *)-ECACHE_NOT_READY);
diff --git a/iocore/cache/I_Cache.h b/iocore/cache/I_Cache.h
index 39a1101..76fad29 100644
--- a/iocore/cache/I_Cache.h
+++ b/iocore/cache/I_Cache.h
@@ -54,7 +54,7 @@ enum { RAM_HIT_COMPRESS_NONE = 1, RAM_HIT_COMPRESS_FASTLZ, RAM_HIT_COMPRESS_LIBZ
 struct CacheVC;
 struct CacheDisk;
 #ifdef HTTP_CACHE
-class CacheLookupHttpConfig;
+struct OverridableHttpConfigParams;
 class URL;
 class HTTPHdr;
 class HTTPInfo;
@@ -94,7 +94,7 @@ struct CacheProcessor : public Processor {
   Action *lookup(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, bool local_only = false,
                  CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
   inkcoreapi Action *open_read(Continuation *cont, const HttpCacheKey *key, bool cluster_cache_local, CacheHTTPHdr *request,
-                               CacheLookupHttpConfig *params, time_t pin_in_cache = (time_t)0,
+                               OverridableHttpConfigParams *params, time_t pin_in_cache = (time_t)0,
                                CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
   Action *open_write(Continuation *cont, int expected_size, const HttpCacheKey *key, bool cluster_cache_local,
                      CacheHTTPHdr *request, CacheHTTPInfo *old_info, time_t pin_in_cache = (time_t)0,
diff --git a/iocore/cache/P_CacheInternal.h b/iocore/cache/P_CacheInternal.h
index d8bc466..09ed81e 100644
--- a/iocore/cache/P_CacheInternal.h
+++ b/iocore/cache/P_CacheInternal.h
@@ -447,7 +447,7 @@ struct CacheVC : public CacheVConnection {
   CacheHTTPInfo *info;
   CacheHTTPInfoVector *write_vector;
 #ifdef HTTP_CACHE
-  CacheLookupHttpConfig *params;
+  OverridableHttpConfigParams *params;
 #endif
   int header_len;        // for communicating with agg_copy
   int frag_len;          // for communicating with agg_copy
@@ -988,7 +988,7 @@ struct Cache {
   Action *scan(Continuation *cont, const char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
 
 #ifdef HTTP_CACHE
-  Action *open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, CacheLookupHttpConfig *params,
+  Action *open_read(Continuation *cont, const CacheKey *key, CacheHTTPHdr *request, OverridableHttpConfigParams *params,
                     CacheFragType type, const char *hostname, int host_len);
   Action *open_write(Continuation *cont, const CacheKey *key, CacheHTTPInfo *old_info, time_t pin_in_cache = (time_t)0,
                      const CacheKey *key1 = nullptr, CacheFragType type = CACHE_FRAG_TYPE_HTTP, const char *hostname = 0,
diff --git a/iocore/cache/P_CacheTest.h b/iocore/cache/P_CacheTest.h
index 9e291e8..196b093 100644
--- a/iocore/cache/P_CacheTest.h
+++ b/iocore/cache/P_CacheTest.h
@@ -76,7 +76,6 @@ struct CacheTestSM : public RegressionSM {
   MIOBuffer *buffer;
   IOBufferReader *buffer_reader;
 #ifdef HTTP_CACHE
-  CacheLookupHttpConfig params;
   CacheHTTPInfo info;
   char urlstr[1024];
 #endif
diff --git a/iocore/cluster/ClusterCache.cc b/iocore/cluster/ClusterCache.cc
index 59afb4b..0a3a816 100644
--- a/iocore/cluster/ClusterCache.cc
+++ b/iocore/cluster/ClusterCache.cc
@@ -1156,15 +1156,8 @@ cache_op_ClusterFunction(ClusterHandler *ch, void *data, int len)
     moi_len -= res;
     p += res;
     ink_assert(moi_len > 0);
-    // Unmarshal CacheLookupHttpConfig
-    c->ic_params = new (CacheLookupHttpConfigAllocator.alloc()) CacheLookupHttpConfig();
-    res          = c->ic_params->unmarshal(&c->ic_arena, (const char *)p, moi_len);
-    ink_assert(res > 0);
-
-    moi_len -= res;
-    p += res;
 
-    CacheKey key(msg->url_md5);
+    c->http_config_params = HttpConfig::acquire();
 
     char *hostname = nullptr;
     int host_len   = 0;
@@ -1182,8 +1175,11 @@ cache_op_ClusterFunction(ClusterHandler *ch, void *data, int len)
       memcpy(c->ic_hostname->data(), hostname, host_len);
     }
 
+    // This is technically not correct, since we're not treating these properly as overridable. But,
+    // this is dead code (mostly), and they weren't overridable before.
+    CacheKey key(msg->url_md5);
     Cache *call_cache = caches[c->frag_type];
-    Action *a         = call_cache->open_read(c, &key, &c->ic_request, c->ic_params, c->frag_type, hostname, host_len);
+    Action *a = call_cache->open_read(c, &key, &c->ic_request, &c->http_config_params->oride, c->frag_type, hostname, host_len);
     // Get rid of purify warnings since 'c' can be freed by open_read.
     if (a != ACTION_RESULT_DONE) {
       c->cache_action = a;
diff --git a/iocore/cluster/P_ClusterCacheInternal.h b/iocore/cluster/P_ClusterCacheInternal.h
index 88975c3..9b6cce9 100644
--- a/iocore/cluster/P_ClusterCacheInternal.h
+++ b/iocore/cluster/P_ClusterCacheInternal.h
@@ -161,7 +161,7 @@ struct CacheContinuation : public Continuation {
   Arena ic_arena;
   CacheHTTPHdr ic_request;
   CacheHTTPHdr ic_response;
-  CacheLookupHttpConfig *ic_params;
+  HttpConfigParams *http_config_params;
   CacheHTTPInfo ic_old_info;
   CacheHTTPInfo ic_new_info;
   Ptr<IOBufferData> ic_hostname;
@@ -250,11 +250,7 @@ struct CacheContinuation : public Continuation {
     if (cache_vc_info.valid()) {
       cache_vc_info.destroy();
     }
-    // Deallocate unmarshaled data
-    if (ic_params) {
-      delete ic_params;
-      ic_params = 0;
-    }
+
     if (ic_request.valid()) {
       ic_request.clear();
     }
@@ -267,6 +263,12 @@ struct CacheContinuation : public Continuation {
     if (ic_new_info.valid()) {
       ic_new_info.destroy();
     }
+
+    if (http_config_params) {
+      HttpConfig::release(http_config_params);
+      http_config_params = 0;
+    }
+
     ic_arena.reset();
     freeMsgBuffer();
 
@@ -316,7 +318,7 @@ struct CacheContinuation : public Continuation {
       ic_arena(),
       ic_request(),
       ic_response(),
-      ic_params(0),
+      http_config_params(nullptr),
       ic_old_info(),
       ic_new_info(),
       ic_hostname_len(0),
diff --git a/iocore/cluster/P_ClusterInline.h b/iocore/cluster/P_ClusterInline.h
index 27230dd..fc7e54e 100644
--- a/iocore/cluster/P_ClusterInline.h
+++ b/iocore/cluster/P_ClusterInline.h
@@ -60,10 +60,8 @@ Cluster_lookup(Continuation *cont, const CacheKey *key, CacheFragType frag_type,
 
 inline Action *
 Cluster_read(ClusterMachine *owner_machine, int opcode, Continuation *cont, MIOBuffer *buf, CacheHTTPHdr *request,
-             CacheLookupHttpConfig *params, const CacheKey *key, time_t pin_in_cache, CacheFragType frag_type, const char *hostname,
-             int hostlen)
+             const CacheKey *key, time_t pin_in_cache, CacheFragType frag_type, const char *hostname, int hostlen)
 {
-  (void)params;
   if (clusterProcessor.disable_remote_cluster_ops(owner_machine)) {
     Action a;
     a = cont;
@@ -85,7 +83,6 @@ Cluster_read(ClusterMachine *owner_machine, int opcode, Continuation *cont, MIOB
       flen = op_to_sizeof_fixedlen_msg(opcode);
 
       len += request->m_heap->marshal_length();
-      len += params->marshal_length();
       len += hostlen;
 
       if ((flen + len) > DEFAULT_MAX_BUFFER_SIZE) // Bound marshalled data
@@ -95,17 +92,11 @@ Cluster_read(ClusterMachine *owner_machine, int opcode, Continuation *cont, MIOB
       msg  = (char *)ALLOCA_DOUBLE(flen + len);
       data = msg + flen;
 
-      int cur_len = len;
-
-      res = request->m_heap->marshal(data, cur_len);
+      res = request->m_heap->marshal(data, len);
       if (res < 0) {
         goto err_exit;
       }
       data += res;
-      cur_len -= res;
-      if ((res = params->marshal(data, cur_len)) < 0)
-        goto err_exit;
-      data += res;
       memcpy(data, hostname, hostlen);
 
       CacheOpArgs_General readArgs;
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index 14d3053..73ea3a4 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -748,6 +748,14 @@ typedef enum {
   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,
+  TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH,
   TS_CONFIG_LAST_ENTRY
 } TSOverridableConfigKey;
 
diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c
index 591a88a..cd8b26f 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -119,12 +119,20 @@ typedef enum {
   TS_LUA_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT       = TS_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT,
   TS_LUA_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS      = TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS,
   TS_LUA_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN            = TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN,
-  TS_LUA_CONFIG_LAST_ENTRY                                    = TS_CONFIG_LAST_ENTRY,
   TS_LUA_CONFIG_SRV_ENABLED                                   = TS_CONFIG_SRV_ENABLED,
   TS_LUA_CONFIG_HTTP_FORWARD_CONNECT_METHOD                   = TS_CONFIG_HTTP_FORWARD_CONNECT_METHOD,
   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,
+  TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH     = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH,
+  TS_LUA_CONFIG_LAST_ENTRY                                    = TS_CONFIG_LAST_ENTRY,
 } TSLuaOverridableConfigKey;
 
 typedef enum {
@@ -240,6 +248,14 @@ 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),
+  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
 };
 
diff --git a/proxy/ICP.cc b/proxy/ICP.cc
index abc166d..04864b1 100644
--- a/proxy/ICP.cc
+++ b/proxy/ICP.cc
@@ -43,7 +43,6 @@
 #include "BaseManager.h"
 #include "HdrUtils.h"
 
-extern CacheLookupHttpConfig global_cache_lookup_config;
 HTTPHdr gclient_request;
 
 //****************************************************************************
@@ -312,11 +311,13 @@ ICPPeerReadCont::init(ICPProcessor *ICPpr, Peer *p, int lookup_local)
   _object_read                = nullptr;
   _cache_req_hdr_heap_handle  = nullptr;
   _cache_resp_hdr_heap_handle = nullptr;
+  _http_config_params         = HttpConfig::acquire();
   mutex                       = new_ProxyMutex();
 }
 
 ICPPeerReadCont::~ICPPeerReadCont()
 {
+  HttpConfig::release(_http_config_params);
   reset(1); // Full reset
 }
 
@@ -472,7 +473,9 @@ ICPPeerReadCont::ICPPeerQueryCont(int /* event ATS_UNUSED */, Event * /* e ATS_U
       // Note: _cache_lookup_local is ignored in this case, since
       //       cache clustering is not used with stale lookup.
       //////////////////////////////////////////////////////////////
-      a = cacheProcessor.open_read(this, &key, false, &gclient_request, &global_cache_lookup_config, (time_t)0);
+
+      // ToDo: This is maybe not 100% correct, since this is not using the txnp (but the global overridable copy)
+      a = cacheProcessor.open_read(this, &key, false, &gclient_request, &_http_config_params->oride, (time_t)0);
     } else {
       a = cacheProcessor.lookup(this, &key, false, _state->_cache_lookup_local);
     }
diff --git a/proxy/ICP.h b/proxy/ICP.h
index a7fe978..530c24a 100644
--- a/proxy/ICP.h
+++ b/proxy/ICP.h
@@ -1166,6 +1166,8 @@ public:
   HTTPInfo *_object_read;
   HdrHeapSDKHandle *_cache_req_hdr_heap_handle;
   HdrHeapSDKHandle *_cache_resp_hdr_heap_handle;
+  // HTTP Config
+  HttpConfigParams *_http_config_params;
 
 private:
   // Class data
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 2dee4fe..6e343f3 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -8110,6 +8110,30 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
   case TS_CONFIG_PARENT_FAILURES_UPDATE_HOSTDB:
     ret = _memberp_to_generic(&overridableHttpConfig->parent_failures_update_hostdb, typep);
     break;
+  case TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER:
+    ret = _memberp_to_generic(&overridableHttpConfig->cache_enable_default_vary_headers, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT:
+    ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_text, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES:
+    ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_images, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER:
+    ret = _memberp_to_generic(&overridableHttpConfig->cache_vary_default_other, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH:
+    ret = _memberp_to_generic(&overridableHttpConfig->ignore_accept_mismatch, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH:
+    ret = _memberp_to_generic(&overridableHttpConfig->ignore_accept_language_mismatch, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH:
+    ret = _memberp_to_generic(&overridableHttpConfig->ignore_accept_encoding_mismatch, typep);
+    break;
+  case TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH:
+    ret = _memberp_to_generic(&overridableHttpConfig->ignore_accept_charset_mismatch, typep);
+    break;
   // This helps avoiding compiler warnings, yet detect unhandled enum members.
   case TS_CONFIG_NULL:
   case TS_CONFIG_LAST_ENTRY:
@@ -8545,6 +8569,12 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
         cnf = TS_CONFIG_HTTP_FLOW_CONTROL_HIGH_WATER_MARK;
       }
       break;
+    case 't':
+      if (!strncmp(name, "proxy.config.http.cache.vary_default_text", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_TEXT;
+        typ = TS_RECORDDATATYPE_STRING;
+      }
+      break;
     }
     break;
 
@@ -8568,6 +8598,9 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
       } else if (!strncmp(name, "proxy.config.http.global_user_agent_header", length)) {
         cnf = TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER;
         typ = TS_RECORDDATATYPE_STRING;
+      } else if (!strncmp(name, "proxy.config.http.cache.vary_default_other", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_OTHER;
+        typ = TS_RECORDDATATYPE_STRING;
       }
       break;
     case 't':
@@ -8607,6 +8640,12 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
         cnf = TS_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR;
       }
       break;
+    case 's':
+      if (!strncmp(name, "proxy.config.http.cache.vary_default_images", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_VARY_DEFAULT_IMAGES;
+        typ = TS_RECORDDATATYPE_STRING;
+      }
+      break;
     }
     break;
 
@@ -8679,6 +8718,18 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
         cnf = TS_CONFIG_HTTP_ORIGIN_MAX_CONNECTIONS_QUEUE;
       }
       break;
+    case 'h':
+      if (0 == strncmp(name, "proxy.config.http.server_session_sharing.match", length)) {
+        cnf = TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH;
+      } else if (!strncmp(name, "proxy.config.http.cache.ignore_accept_mismatch", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_MISMATCH;
+      }
+      break;
+    case 'n':
+      if (!strncmp(name, "proxy.config.http.cache.open_write_fail_action", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_OPEN_WRITE_FAIL_ACTION;
+      }
+      break;
     case 'r':
       if (!strncmp(name, "proxy.config.http.insert_squid_x_forwarded_for", length)) {
         cnf = TS_CONFIG_HTTP_INSERT_SQUID_X_FORWARDED_FOR;
@@ -8696,16 +8747,6 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
         cnf = TS_CONFIG_HTTP_FORWARD_PROXY_AUTH_TO_PARENT;
       }
       break;
-    case 'h':
-      if (0 == strncmp(name, "proxy.config.http.server_session_sharing.match", length)) {
-        cnf = TS_CONFIG_HTTP_SERVER_SESSION_SHARING_MATCH;
-      }
-      break;
-    case 'n':
-      if (!strncmp(name, "proxy.config.http.cache.open_write_fail_action", length)) {
-        cnf = TS_CONFIG_HTTP_CACHE_OPEN_WRITE_FAIL_ACTION;
-      }
-      break;
     }
     break;
 
@@ -8791,6 +8832,11 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
         cnf = TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED;
       }
       break;
+    case 's':
+      if (!strncmp(name, "proxy.config.http.cache.enable_default_vary_headers", length)) {
+        cnf = TS_CONFIG_HTTP_CACHE_ENABLE_DEFAULT_VARY_HEADER;
+      }
+      break;
     }
     break;
 
@@ -8837,6 +8883,20 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
     }
     break;
 
+  case 54:
+    if (!strncmp(name, "proxy.config.http.cache.ignore_accept_charset_mismatch", length)) {
+      cnf = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_CHARSET_MISMATCH;
+    }
+    break;
+
+  case 55:
+    if (!strncmp(name, "proxy.config.http.cache.ignore_accept_language_mismatch", length)) {
+      cnf = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_LANGUAGE_MISMATCH;
+    } else if (!strncmp(name, "proxy.config.http.cache.ignore_accept_encoding_mismatch", length)) {
+      cnf = TS_CONFIG_HTTP_CACHE_IGNORE_ACCEPT_ENCODING_MISMATCH;
+    }
+    break;
+
   case 58:
     if (!strncmp(name, "proxy.config.http.connect_attempts_max_retries_dead_server", length)) {
       cnf = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER;
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index ca803ee..857a176 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -7623,6 +7623,14 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
   "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",
+  "proxy.config.http.cache.ignore_accept_charset_mismatch",
 };
 
 REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)
diff --git a/proxy/Prefetch.cc b/proxy/Prefetch.cc
index 3998216..966b2d9 100644
--- a/proxy/Prefetch.cc
+++ b/proxy/Prefetch.cc
@@ -1446,12 +1446,8 @@ PrefetchBlaster::handleEvent(int event, void *data)
 
     // Here, we need to decide if we need to prefetch based on whether it
     // is in the cache or not.
-
-    // if (cache_lookup_necessary) do:
-    initCacheLookupConfig();
-
     Cache::generate_key(&key, request->url_get()); // XXX choose a cache generation number ...
-    cacheProcessor.open_read(this, &key, false, request, &cache_lookup_config, 0);
+    cacheProcessor.open_read(this, &key, false, request, &http_config_params->oride, 0);
 
     break;
   }
@@ -1815,21 +1811,6 @@ PrefetchBlaster::invokeBlaster()
   return 0;
 }
 
-void
-PrefetchBlaster::initCacheLookupConfig()
-{
-  // The look up parameters are intialized in the same as it is done
-  // in HttpSM::init(). Any changes there should come in here.
-  HttpConfigParams *http_config_params                  = HttpConfig::acquire();
-  cache_lookup_config.cache_global_user_agent_header    = http_config_params->oride.global_user_agent_header ? true : false;
-  cache_lookup_config.cache_enable_default_vary_headers = http_config_params->cache_enable_default_vary_headers ? true : false;
-  cache_lookup_config.cache_vary_default_text           = http_config_params->cache_vary_default_text;
-  cache_lookup_config.cache_vary_default_images         = http_config_params->cache_vary_default_images;
-  cache_lookup_config.cache_vary_default_other          = http_config_params->cache_vary_default_other;
-
-  HttpConfig::release(http_config_params);
-}
-
 static int
 config_read_proto(TSPrefetchBlastData &blast, const char *str)
 {
diff --git a/proxy/Prefetch.h b/proxy/Prefetch.h
index 91d9b06..ae5aa02 100644
--- a/proxy/Prefetch.h
+++ b/proxy/Prefetch.h
@@ -303,8 +303,12 @@ public:
       serverVC(0),
       n_pkts_sent(0),
       seq_no(0),
-      io_block(0){};
-  ~PrefetchBlaster(){};
+      io_block(0)
+  {
+    http_config_params = HttpConfig::acquire();
+  };
+
+  ~PrefetchBlaster() { HttpConfig::release(http_config_params); };
 
   int init(PrefetchUrlEntry *entry, HTTPHdr *request, PrefetchTransform *p_trans);
 
@@ -314,7 +318,6 @@ public:
   int httpClient(int event, void *data);
 
   int invokeBlaster();
-  void initCacheLookupConfig();
 
   void handleCookieHeaders(HTTPHdr *req_hdr, HTTPHdr *resp_hdr, const char *domain_start, const char *domain_end,
                            const char *host_start, int host_len, bool no_dot);
@@ -334,8 +337,7 @@ public:
   VConnection *serverVC;
 
   TSPrefetchBlastData data_blast;
-
-  CacheLookupHttpConfig cache_lookup_config;
+  HttpConfigParams *http_config_params;
 
   // udp related:
   uint32_t n_pkts_sent;
diff --git a/proxy/http/HttpCacheSM.cc b/proxy/http/HttpCacheSM.cc
index 7ad75a5..74cdfca 100644
--- a/proxy/http/HttpCacheSM.cc
+++ b/proxy/http/HttpCacheSM.cc
@@ -75,7 +75,7 @@ HttpCacheSM::HttpCacheSM()
     open_write_cb(false),
     open_read_tries(0),
     read_request_hdr(nullptr),
-    read_config(nullptr),
+    http_params(nullptr),
     read_pin_in_cache(0),
     retry_write(true),
     open_write_tries(0),
@@ -251,7 +251,7 @@ HttpCacheSM::do_cache_open_read(const HttpCacheKey &key)
   // Initialising read-while-write-inprogress flag
   this->readwhilewrite_inprogress = false;
   Action *action_handle           = cacheProcessor.open_read(this, &key, master_sm->t_state.cache_control.cluster_cache_local,
-                                                   this->read_request_hdr, this->read_config, this->read_pin_in_cache);
+                                                   this->read_request_hdr, this->http_params, this->read_pin_in_cache);
 
   if (action_handle != ACTION_RESULT_DONE) {
     pending_action = action_handle;
@@ -269,14 +269,14 @@ HttpCacheSM::do_cache_open_read(const HttpCacheKey &key)
 }
 
 Action *
-HttpCacheSM::open_read(const HttpCacheKey *key, URL *url, HTTPHdr *hdr, CacheLookupHttpConfig *params, time_t pin_in_cache)
+HttpCacheSM::open_read(const HttpCacheKey *key, URL *url, HTTPHdr *hdr, OverridableHttpConfigParams *params, time_t pin_in_cache)
 {
   Action *act_return;
 
   cache_key         = *key;
   lookup_url        = url;
   read_request_hdr  = hdr;
-  read_config       = params;
+  http_params       = params;
   read_pin_in_cache = pin_in_cache;
   ink_assert(pending_action == nullptr);
   SET_HANDLER(&HttpCacheSM::state_cache_open_read);
diff --git a/proxy/http/HttpCacheSM.h b/proxy/http/HttpCacheSM.h
index cf2702c..4037d78 100644
--- a/proxy/http/HttpCacheSM.h
+++ b/proxy/http/HttpCacheSM.h
@@ -41,7 +41,6 @@
 
 class HttpSM;
 class HttpCacheSM;
-class CacheLookupHttpConfig;
 
 struct HttpCacheAction : public Action {
   HttpCacheAction();
@@ -67,7 +66,7 @@ public:
     captive_action.init(this);
   }
 
-  Action *open_read(const HttpCacheKey *key, URL *url, HTTPHdr *hdr, CacheLookupHttpConfig *params, time_t pin_in_cache);
+  Action *open_read(const HttpCacheKey *key, URL *url, HTTPHdr *hdr, OverridableHttpConfigParams *params, time_t pin_in_cache);
 
   Action *open_write(const HttpCacheKey *key, URL *url, HTTPHdr *request, CacheHTTPInfo *old_info, time_t pin_in_cache, bool retry,
                      bool allow_multiple);
@@ -198,7 +197,7 @@ private:
   // Open read parameters
   int open_read_tries;
   HTTPHdr *read_request_hdr;
-  CacheLookupHttpConfig *read_config;
+  OverridableHttpConfigParams *http_params;
   time_t read_pin_in_cache;
 
   // Open write parameters
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 8b60753..9f3e665 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1021,9 +1021,9 @@ HttpConfig::startup()
   HttpEstablishStaticConfigLongLong(c.oride.freshness_fuzz_min_time, "proxy.config.http.cache.fuzz.min_time");
   HttpEstablishStaticConfigFloat(c.oride.freshness_fuzz_prob, "proxy.config.http.cache.fuzz.probability");
 
-  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_text, "proxy.config.http.cache.vary_default_text");
-  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_images, "proxy.config.http.cache.vary_default_images");
-  HttpEstablishStaticConfigStringAlloc(c.cache_vary_default_other, "proxy.config.http.cache.vary_default_other");
+  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");
@@ -1043,13 +1043,13 @@ 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.cache_enable_default_vary_headers, "proxy.config.http.cache.enable_default_vary_headers");
+  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.ignore_accept_mismatch, "proxy.config.http.cache.ignore_accept_mismatch");
-  HttpEstablishStaticConfigByte(c.ignore_accept_language_mismatch, "proxy.config.http.cache.ignore_accept_language_mismatch");
-  HttpEstablishStaticConfigByte(c.ignore_accept_encoding_mismatch, "proxy.config.http.cache.ignore_accept_encoding_mismatch");
-  HttpEstablishStaticConfigByte(c.ignore_accept_charset_mismatch, "proxy.config.http.cache.ignore_accept_charset_mismatch");
+  HttpEstablishStaticConfigByte(c.oride.ignore_accept_mismatch, "proxy.config.http.cache.ignore_accept_mismatch");
+  HttpEstablishStaticConfigByte(c.oride.ignore_accept_language_mismatch, "proxy.config.http.cache.ignore_accept_language_mismatch");
+  HttpEstablishStaticConfigByte(c.oride.ignore_accept_encoding_mismatch, "proxy.config.http.cache.ignore_accept_encoding_mismatch");
+  HttpEstablishStaticConfigByte(c.oride.ignore_accept_charset_mismatch, "proxy.config.http.cache.ignore_accept_charset_mismatch");
 
   HttpEstablishStaticConfigByte(c.send_100_continue_response, "proxy.config.http.send_100_continue_response");
   HttpEstablishStaticConfigByte(c.disallow_post_100_continue, "proxy.config.http.disallow_post_100_continue");
@@ -1309,9 +1309,9 @@ HttpConfig::reconfigure()
   params->oride.freshness_fuzz_min_time = m_master.oride.freshness_fuzz_min_time;
   params->oride.freshness_fuzz_prob     = m_master.oride.freshness_fuzz_prob;
 
-  params->cache_vary_default_text   = ats_strdup(m_master.cache_vary_default_text);
-  params->cache_vary_default_images = ats_strdup(m_master.cache_vary_default_images);
-  params->cache_vary_default_other  = ats_strdup(m_master.cache_vary_default_other);
+  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;
 
@@ -1323,22 +1323,22 @@ 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_cluster_cache_local      = INT_TO_BOOL(m_master.oride.cache_cluster_cache_local);
-  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_enable_default_vary_headers    = INT_TO_BOOL(m_master.cache_enable_default_vary_headers);
-  params->cache_post_method                    = INT_TO_BOOL(m_master.cache_post_method);
-
-  params->ignore_accept_mismatch          = m_master.ignore_accept_mismatch;
-  params->ignore_accept_language_mismatch = m_master.ignore_accept_language_mismatch;
-  params->ignore_accept_encoding_mismatch = m_master.ignore_accept_encoding_mismatch;
-  params->ignore_accept_charset_mismatch  = m_master.ignore_accept_charset_mismatch;
+  params->oride.cache_http                        = INT_TO_BOOL(m_master.oride.cache_http);
+  params->oride.cache_cluster_cache_local         = INT_TO_BOOL(m_master.oride.cache_cluster_cache_local);
+  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.ignore_accept_mismatch          = m_master.oride.ignore_accept_mismatch;
+  params->oride.ignore_accept_language_mismatch = m_master.oride.ignore_accept_language_mismatch;
+  params->oride.ignore_accept_encoding_mismatch = m_master.oride.ignore_accept_encoding_mismatch;
+  params->oride.ignore_accept_charset_mismatch  = m_master.oride.ignore_accept_charset_mismatch;
 
   params->send_100_continue_response = INT_TO_BOOL(m_master.send_100_continue_response);
   params->disallow_post_100_continue = INT_TO_BOOL(m_master.disallow_post_100_continue);
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index f4c6f44..f2169a1 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -404,6 +404,11 @@ struct OverridableHttpConfigParams {
       cache_required_headers(2),
       cache_range_lookup(1),
       cache_range_write(0),
+      cache_enable_default_vary_headers(0),
+      ignore_accept_mismatch(0),
+      ignore_accept_language_mismatch(0),
+      ignore_accept_encoding_mismatch(0),
+      ignore_accept_charset_mismatch(0),
       insert_request_via_string(1),
       insert_response_via_string(0),
       doc_in_cache_skip_dns(1),
@@ -473,7 +478,10 @@ struct OverridableHttpConfigParams {
       freshness_fuzz_prob(0.005),
       background_fill_threshold(0.5),
       client_cert_filename(NULL),
-      client_cert_filepath(NULL)
+      client_cert_filepath(NULL),
+      cache_vary_default_text(NULL),
+      cache_vary_default_images(NULL),
+      cache_vary_default_other(NULL)
   {
   }
 
@@ -546,6 +554,13 @@ struct OverridableHttpConfigParams {
   MgmtByte cache_range_lookup;
   MgmtByte cache_range_write;
 
+  MgmtByte cache_enable_default_vary_headers;
+
+  MgmtByte ignore_accept_mismatch;
+  MgmtByte ignore_accept_language_mismatch;
+  MgmtByte ignore_accept_encoding_mismatch;
+  MgmtByte ignore_accept_charset_mismatch;
+
   MgmtByte insert_request_via_string;
   MgmtByte insert_response_via_string;
 
@@ -688,8 +703,14 @@ struct OverridableHttpConfigParams {
   MgmtFloat cache_heuristic_lm_factor;
   MgmtFloat freshness_fuzz_prob;
   MgmtFloat background_fill_threshold;
+
+  // Various strings, good place for them here ...
   char *client_cert_filename;
   char *client_cert_filepath;
+
+  char *cache_vary_default_text;
+  char *cache_vary_default_images;
+  char *cache_vary_default_other;
 };
 
 /////////////////////////////////////////////////////////////
@@ -747,10 +768,6 @@ public:
   ///////////////////////////////////////////////////////////////////
   char *anonymize_other_header_list;
 
-  char *cache_vary_default_text;
-  char *cache_vary_default_images;
-  char *cache_vary_default_other;
-
   ////////////////////////////////////////////
   // CONNECT ports (used to be == ssl_ports //
   ////////////////////////////////////////////
@@ -786,7 +803,6 @@ public:
   MgmtByte icp_enabled;
   MgmtByte stale_icp_enabled;
 
-  MgmtByte cache_enable_default_vary_headers;
   MgmtByte cache_post_method;
 
   MgmtByte push_method_enabled;
@@ -806,11 +822,6 @@ public:
 
   MgmtByte redirection_host_no_port;
 
-  MgmtByte ignore_accept_mismatch;
-  MgmtByte ignore_accept_language_mismatch;
-  MgmtByte ignore_accept_encoding_mismatch;
-  MgmtByte ignore_accept_charset_mismatch;
-
   MgmtByte send_100_continue_response;
   MgmtByte disallow_post_100_continue;
   MgmtByte parser_allow_non_http;
@@ -884,9 +895,6 @@ inline HttpConfigParams::HttpConfigParams()
     per_parent_connect_attempts(2),
     parent_connect_timeout(30),
     anonymize_other_header_list(NULL),
-    cache_vary_default_text(NULL),
-    cache_vary_default_images(NULL),
-    cache_vary_default_other(NULL),
     connect_ports_string(NULL),
     connect_ports(NULL),
     proxy_hostname(NULL),
@@ -905,7 +913,6 @@ inline HttpConfigParams::HttpConfigParams()
     enable_http_stats(1),
     icp_enabled(0),
     stale_icp_enabled(0),
-    cache_enable_default_vary_headers(0),
     cache_post_method(0),
     push_method_enabled(0),
     referer_filter_enabled(0),
@@ -917,10 +924,6 @@ inline HttpConfigParams::HttpConfigParams()
     errors_log_error_pages(1),
     enable_http_info(0),
     redirection_host_no_port(1),
-    ignore_accept_mismatch(0),
-    ignore_accept_language_mismatch(0),
-    ignore_accept_encoding_mismatch(0),
-    ignore_accept_charset_mismatch(0),
     send_100_continue_response(0),
     disallow_post_100_continue(0),
     parser_allow_non_http(1),
@@ -941,9 +944,9 @@ inline HttpConfigParams::~HttpConfigParams()
   ats_free(oride.global_user_agent_header);
   ats_free(oride.client_cert_filename);
   ats_free(oride.client_cert_filepath);
-  ats_free(cache_vary_default_text);
-  ats_free(cache_vary_default_images);
-  ats_free(cache_vary_default_other);
+  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);
 
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 464b628..44b2656 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -394,20 +394,6 @@ HttpSM::init()
   // entire struct if nothing is going to change it.
   t_state.txn_conf = &t_state.http_config_param->oride;
 
-  // update the cache info config structure so that
-  // selection from alternates happens correctly.
-  t_state.cache_info.config.cache_global_user_agent_header  = t_state.txn_conf->global_user_agent_header ? true : false;
-  t_state.cache_info.config.ignore_accept_mismatch          = t_state.http_config_param->ignore_accept_mismatch;
-  t_state.cache_info.config.ignore_accept_language_mismatch = t_state.http_config_param->ignore_accept_language_mismatch;
-  t_state.cache_info.config.ignore_accept_encoding_mismatch = t_state.http_config_param->ignore_accept_encoding_mismatch;
-  t_state.cache_info.config.ignore_accept_charset_mismatch  = t_state.http_config_param->ignore_accept_charset_mismatch;
-  t_state.cache_info.config.cache_enable_default_vary_headers =
-    t_state.http_config_param->cache_enable_default_vary_headers ? true : false;
-
-  t_state.cache_info.config.cache_vary_default_text   = t_state.http_config_param->cache_vary_default_text;
-  t_state.cache_info.config.cache_vary_default_images = t_state.http_config_param->cache_vary_default_images;
-  t_state.cache_info.config.cache_vary_default_other  = t_state.http_config_param->cache_vary_default_other;
-
   t_state.init();
 
   // Added to skip dns if the document is in cache. DNS will be forced if there is a ip based ACL in
@@ -4580,7 +4566,7 @@ HttpSM::do_cache_lookup_and_read()
   Cache::generate_key(&key, c_url, t_state.txn_conf->cache_generation_number);
 
   Action *cache_action_handle =
-    cache_sm.open_read(&key, c_url, &t_state.hdr_info.client_request, &(t_state.cache_info.config),
+    cache_sm.open_read(&key, c_url, &t_state.hdr_info.client_request, t_state.txn_conf,
                        (time_t)((t_state.cache_control.pin_in_cache_for < 0) ? 0 : t_state.cache_control.pin_in_cache_for));
   //
   // pin_in_cache value is an open_write parameter.
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 6d451dd..1d47619 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -598,7 +598,6 @@ public:
     HTTPInfo *second_object_read;
     HTTPInfo object_store;
     HTTPInfo transform_store;
-    CacheLookupHttpConfig config;
     CacheDirectives directives;
     int open_read_retries;
     int open_write_retries;
@@ -620,7 +619,6 @@ public:
         second_object_read(NULL),
         object_store(),
         transform_store(),
-        config(),
         directives(),
         open_read_retries(0),
         open_write_retries(0),
diff --git a/proxy/http/HttpTransactCache.cc b/proxy/http/HttpTransactCache.cc
index af1adb5..f03eb32 100644
--- a/proxy/http/HttpTransactCache.cc
+++ b/proxy/http/HttpTransactCache.cc
@@ -31,10 +31,6 @@
 #include "HttpCompat.h"
 #include "ts/InkErrno.h"
 
-ClassAllocator<CacheLookupHttpConfig> CacheLookupHttpConfigAllocator("CacheLookupHttpConfigAllocator");
-
-CacheLookupHttpConfig global_cache_lookup_config;
-
 /**
   Find the pointer and length of an etag, after stripping off any leading
   "W/" prefix, and surrounding double quotes.
@@ -168,7 +164,7 @@ is_empty(char *s)
 */
 int
 HttpTransactCache::SelectFromAlternates(CacheHTTPInfoVector *cache_vector, HTTPHdr *client_request,
-                                        CacheLookupHttpConfig *http_config_params)
+                                        OverridableHttpConfigParams *http_config_params)
 {
   time_t current_age, best_age = CacheHighAgeWatermark;
   time_t t_now         = 0;
@@ -188,10 +184,9 @@ HttpTransactCache::SelectFromAlternates(CacheHTTPInfoVector *cache_vector, HTTPH
     fprintf(stderr, "[alts] There are %d alternates for this request header.\n", alt_count);
     RELEASE_PRINT_LOCK()
   }
-  // used by ICP to bypass this function
-  if (http_config_params == &global_cache_lookup_config) {
-    return 0;
-  }
+
+  // ToDo: Need a way to detect if it's ICP here or not, and then "return 0;". That's what the old
+  // code did, in a very convoluted way ...
 
   if (!client_request->valid()) {
     return 0;
@@ -299,7 +294,7 @@ HttpTransactCache::SelectFromAlternates(CacheHTTPInfoVector *cache_vector, HTTPH
 
 */
 float
-HttpTransactCache::calculate_quality_of_match(CacheLookupHttpConfig *http_config_param, HTTPHdr *client_request,
+HttpTransactCache::calculate_quality_of_match(OverridableHttpConfigParams *http_config_param, HTTPHdr *client_request,
                                               HTTPHdr *obj_client_request, HTTPHdr *obj_origin_server_response)
 {
   // For PURGE requests, any alternate is good really.
@@ -1144,8 +1139,8 @@ language_wildcard:
 
 */
 Variability_t
-HttpTransactCache::CalcVariability(CacheLookupHttpConfig *http_config_params, HTTPHdr *client_request, HTTPHdr *obj_client_request,
-                                   HTTPHdr *obj_origin_server_response)
+HttpTransactCache::CalcVariability(OverridableHttpConfigParams *http_config_params, HTTPHdr *client_request,
+                                   HTTPHdr *obj_client_request, HTTPHdr *obj_origin_server_response)
 {
   ink_assert(http_config_params != nullptr);
   ink_assert(client_request != nullptr);
@@ -1223,7 +1218,7 @@ HttpTransactCache::CalcVariability(CacheLookupHttpConfig *http_config_params, HT
       // Special case: if 'proxy.config.http.global_user_agent_header' set                  //
       // we should ignore Vary: User-Agent.                                                 //
       ////////////////////////////////////////////////////////////////////////////////////////
-      if (http_config_params->cache_global_user_agent_header && !strcasecmp((char *)field->str, "User-Agent")) {
+      if (http_config_params->global_user_agent_header && !strcasecmp((char *)field->str, "User-Agent")) {
         continue;
       }
 
@@ -1467,95 +1462,3 @@ HttpTransactCache::match_response_to_request_conditionals(HTTPHdr *request, HTTP
 
   return response->status_get();
 }
-
-/*---------------------------------------------------
- *        class CacheLookupHttpConfig
- *---------------------------------------------------*/
-int
-CacheLookupHttpConfig::marshal_length()
-{
-  int len = (int)sizeof(int32_t);
-  len += (cache_vary_default_text ? strlen(cache_vary_default_text) + 1 : 1);
-  len += (cache_vary_default_images ? strlen(cache_vary_default_images) + 1 : 1);
-  len += (cache_vary_default_other ? strlen(cache_vary_default_other) + 1 : 1);
-  return len;
-}
-
-int
-CacheLookupHttpConfig::marshal(char *buf, int length)
-{
-  int32_t i32_tmp;
-  char *p = buf;
-  int len;
-
-  if ((length -= sizeof(int32_t)) < 0) {
-    return -1;
-  }
-
-  i32_tmp = (int32_t)cache_enable_default_vary_headers;
-  memcpy(p, &i32_tmp, sizeof(int32_t));
-  p += sizeof(int32_t);
-
-  len = (cache_vary_default_text ? strlen(cache_vary_default_text) + 1 : 1);
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  ink_strlcpy(p, (cache_vary_default_text ? cache_vary_default_text : ""), length);
-  p += len;
-
-  len = (cache_vary_default_images ? strlen(cache_vary_default_images) + 1 : 1);
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  ink_strlcpy(p, (cache_vary_default_images ? cache_vary_default_images : ""), length);
-  p += len;
-
-  len = (cache_vary_default_other ? strlen(cache_vary_default_other) + 1 : 1);
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  ink_strlcpy(p, (cache_vary_default_other ? cache_vary_default_other : ""), length);
-  p += len;
-
-  return (p - buf);
-}
-
-int
-CacheLookupHttpConfig::unmarshal(Arena *arena, const char *buf, int buflen)
-{
-  const char *p = buf;
-  int length    = buflen;
-  int len;
-  int32_t i32_tmp;
-
-  if ((length -= sizeof(int32_t)) < 0) {
-    return -1;
-  }
-
-  memcpy(&i32_tmp, p, sizeof(int32_t));
-  cache_enable_default_vary_headers = (bool)i32_tmp;
-  p += sizeof(int32_t);
-
-  len = strlen(p) + 1;
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  cache_vary_default_text = arena->str_store(((len == 2) ? "" : p), len - 1);
-  p += len;
-
-  len = strlen(p) + 1;
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  cache_vary_default_images = arena->str_store(((len == 2) ? "" : p), len - 1);
-  p += len;
-
-  len = strlen(p) + 1;
-  if ((length -= len) < 0) {
-    return -1;
-  }
-  cache_vary_default_other = arena->str_store(((len == 2) ? "" : p), len - 1);
-  p += len;
-
-  return (p - buf);
-}
diff --git a/proxy/http/HttpTransactCache.h b/proxy/http/HttpTransactCache.h
index 974a887..b3e7cb2 100644
--- a/proxy/http/HttpTransactCache.h
+++ b/proxy/http/HttpTransactCache.h
@@ -32,64 +32,13 @@
 #define _HttpTransactCache_h_
 
 #include "ts/ink_platform.h"
+#include "HttpConfig.h"
 
 // This is needed since txn_conf->cache_guaranteed_max_lifetime is currently not
 // readily available in the cache. ToDo: We should fix this with TS-1919
 static const time_t CacheHighAgeWatermark = UINT_MAX;
-
 struct CacheHTTPInfoVector;
 
-class CacheLookupHttpConfig
-{
-public:
-  bool cache_global_user_agent_header; // 'global' user agent flag (don't need to marshal/unmarshal)
-  bool cache_enable_default_vary_headers;
-  unsigned ignore_accept_mismatch;
-  unsigned ignore_accept_language_mismatch;
-  unsigned ignore_accept_encoding_mismatch;
-  unsigned ignore_accept_charset_mismatch;
-  char *cache_vary_default_text;
-  char *cache_vary_default_images;
-  char *cache_vary_default_other;
-
-  inkcoreapi int marshal_length();
-  inkcoreapi int marshal(char *buf, int length);
-  int unmarshal(Arena *arena, const char *buf, int length);
-
-  CacheLookupHttpConfig()
-    : cache_global_user_agent_header(false),
-      cache_enable_default_vary_headers(false),
-      ignore_accept_mismatch(0),
-      ignore_accept_language_mismatch(0),
-      ignore_accept_encoding_mismatch(0),
-      ignore_accept_charset_mismatch(0),
-      cache_vary_default_text(NULL),
-      cache_vary_default_images(NULL),
-      cache_vary_default_other(NULL)
-  {
-  }
-
-  void *operator new(size_t size, void *mem);
-  void operator delete(void *mem);
-};
-
-extern ClassAllocator<CacheLookupHttpConfig> CacheLookupHttpConfigAllocator;
-// this is a global CacheLookupHttpConfig used to bypass SelectFromAlternates
-extern CacheLookupHttpConfig global_cache_lookup_config;
-
-inline void *
-CacheLookupHttpConfig::operator new(size_t size, void *mem)
-{
-  (void)size;
-  return mem;
-}
-
-inline void
-CacheLookupHttpConfig::operator delete(void *mem)
-{
-  CacheLookupHttpConfigAllocator.free((CacheLookupHttpConfig *)mem);
-}
-
 enum Variability_t {
   VARIABILITY_NONE = 0,
   VARIABILITY_SOME,
@@ -109,11 +58,10 @@ public:
   /////////////////////////////////
 
   static int SelectFromAlternates(CacheHTTPInfoVector *cache_vector_data, HTTPHdr *client_request,
-                                  CacheLookupHttpConfig *cache_lookup_http_config_params);
+                                  OverridableHttpConfigParams *cache_lookup_http_config_params);
 
-  static float calculate_quality_of_match(CacheLookupHttpConfig *http_config_params, HTTPHdr *client_request, // in
-                                          HTTPHdr *obj_client_request,                                        // in
-                                          HTTPHdr *obj_origin_server_response);                               // in
+  static float calculate_quality_of_match(OverridableHttpConfigParams *http_config_params, HTTPHdr *client_request,
+                                          HTTPHdr *obj_client_request, HTTPHdr *obj_origin_server_response);
 
   static float calculate_quality_of_accept_match(MIMEField *accept_field, MIMEField *content_field);
 
@@ -131,10 +79,8 @@ public:
   // variability & server negotiation routines //
   ///////////////////////////////////////////////
 
-  static Variability_t CalcVariability(CacheLookupHttpConfig *http_config_params, HTTPHdr *client_request, // in
-                                       HTTPHdr *obj_client_request,                                        // in
-                                       HTTPHdr *obj_origin_server_response                                 // in
-                                       );
+  static Variability_t CalcVariability(OverridableHttpConfigParams *http_config_params, HTTPHdr *client_request,
+                                       HTTPHdr *obj_client_request, HTTPHdr *obj_origin_server_response);
 
   static HTTPStatus match_response_to_request_conditionals(HTTPHdr *ua_request, HTTPHdr *c_response,
                                                            ink_time_t response_received_time);

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.