I might need to try this out. Not sure about the <cqhl> in there. We have a system which heavily use HEAD requests. I'm also using cache_range_requests so it's impossible get cached HEAD requests.
I've got a few options, but I'll try the one below. Steve On Wed, Mar 30, 2016 at 7:26 PM, Miles Libbey <[email protected]> wrote: > So, perhaps header_rewrite and cachekey... use header_rewrite to put the > method in an internal header; then use cachekey to use that header in the > cachekey? > Header Rewrite Plugin — Apache Traffic Server 6.2.0 documentation > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html#add-header> > > > > > > > Header Rewrite Plugin — Apache Traffic Server 6.2.0 documentation > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html#add-header> > Header Rewrite Plugin This plugin allows you to modify arbitrary headers > based on defined rules, for both requests and responses. Purpose > View on docs.trafficserver.apache.org > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/header_rewrite.en.html#add-header> > Preview by Yahoo > > Cache Key Manipulation Plugin — Apache Traffic Server 6.2.0 documentation > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/cachekey.en.html> > > > > > > > Cache Key Manipulation Plugin — Apache Traffic Server 6.2.0 documentation > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/cachekey.en.html> > Cache Key Manipulation Plugin Description This plugin allows some common > cache key manipulations based on various HTTP request components. It can > View on docs.trafficserver.apache.org > <https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/cachekey.en.html> > Preview by Yahoo > > > > map http://inbound.example.org http://origin.example.org \ > @plugin=header_rewrite.so @pparam=header_conf \ > @plugin=cachekey.so @pparam=--include-headers=@method > > header_conf: > cond %{REMAP_PSEUDO_HOOK} > add-header @Method %<cqhl> > > miles > > > > On Wednesday, March 30, 2016 9:20 AM, Sudheer Vinukonda < > [email protected]> wrote: > > Regardless, the important thing to note is what Leif mentioned - if you > plan on caching HEAD, then your cache key should include the method (this > should be possible with a plugin or even the Gancho's cachekey plugin?). > Otherwise, there's a danger of serving broken responses to GET requests. > > On Wednesday, March 30, 2016 9:01 AM, Leif Hedstrom <[email protected]> > wrote: > > > > > > On Mar 30, 2016, at 8:41 AM, Esmq <[email protected]> wrote: > > > >set proxy.config.http.cache.allow_empty_doc to 1 can't have head request > cached. > >and only if object was in cache already, head request will satisfy from > cache. > > > > > >can ats cached head request ? > > > > > No. Looking at the code, I don’t see a way to force it to do so, and > regardless, that would imply that the cache key would have to include the > request method as well as the URL (which I’m fairly certain we do not do > either). > > — Leif > > >
