trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Moseley <moseleym...@gmail.com>
Subject Re: Adding headers to 304 Responses
Date Sat, 23 Nov 2013 07:40:29 GMT
On Fri, Nov 22, 2013 at 7:24 PM, Shu Kit Chan <chanshukit@gmail.com> wrote:

> I think the problem is not with the plugin. The debug log is telling us
> that, i think.
> We can add a static header to the 304 response with no problem.
>
> The situation is that -
>
> 1) There is a custom header (X-From-Apache) in the original response from
> origin server.
> 2) This response is cached in ATS
> 3) When client uses IMS in the request, ATS responds with a 304.
> 4) The custom header is nowhere to be found in the 304 respond
> 5) And thus the header_rewrite plugin cannot get its value.
>
> I think ATS is doing the right thing for 304 as mentioned here -
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5
> So how do we override this behavior and/or let the header_rewrite plugin
> to know about the X-From-Apache header in the original response?
>

Yeah, I don't mean to imply at any point that ATS is doing the wrong thing.
I'm just trying to make it do something different :)

Your #1-5 sounds correct. Interestingly, for the 304s, the X-From-Apache
header doesn't even get logged using the custom log %<{X-From-Apache}ssh>
tag (though it does get logged successfully
for non-IMS requests just fine).

The background is that I'm working on fronting existing web servers with
ATS. The existing Apache servers use the (real) headers I'm trying to add
in their logging, so I'm trying to get those
same headers working with ATS so I can avoid overhauling the log processing
that's already in place (it's a fairly big infrastructure, so it wouldn't
be a trivial thing to do -- so non-trivial that I'd rather
modify the source code of ATS).

Everything else works great and I thought I was pretty much done, since I'd
only ever tested non-conditional requests. But those have tripped me up a
bit, so I'm looking for workarounds.

Mime
View raw message