You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Brendan Webb <we...@ohsu.edu> on 2013/04/03 20:44:23 UTC

406 responses being cached

I'm running ATS 3.0.4 in front of IIS 7.5.

Every so often, a random .css or .js file gets cached by ATS and requests return a '406 Unacceptable' response code.

I've yet to be able to reproduce this myself, but when it does happen in our production environment, the cached file has a Content-Type:text/html.

MIME types are set properly on IIS for .css (text/css) and .js (application/x-javascript).

Wondering if anyone has seen anything like this. I've been stumped as to where to even start troubleshooting.

Is there a way to tell ATS not to cache 406 responses?

Brendan Webb
Web Engineer
Oregon Health & Science University
(503) 418-3346

Re: 406 responses being cached

Posted by Brendan Webb <we...@ohsu.edu>.
Thanks for the idea. IIS doesn't seem to want to allow you to set custom Cache-Control headers on the default error handler pages, but if you define a custom 406 handler, you can set your own headers there. I did this and added some logging to capture the offending requests which were generating 406 responses. Problem solved!



From: Conan <co...@gmail.com>>
Reply-To: "users@trafficserver.apache.org<ma...@trafficserver.apache.org>" <us...@trafficserver.apache.org>>
Date: Saturday, April 6, 2013 12:44 AM
To: "users@trafficserver.apache.org<ma...@trafficserver.apache.org>" <us...@trafficserver.apache.org>>
Subject: Re: 406 responses being cached

On Thu, Apr 4, 2013 at 2:44 AM, Brendan Webb <we...@ohsu.edu>> wrote:
I'm running ATS 3.0.4 in front of IIS 7.5.

Is there a way to tell ATS not to cache 406 responses?

AFAIK, if you can add a "Cache-Control: no-cache" header on IIS for 406 response, ATS will not cache it.

If unable to configure on IIS, you can try to add that header on ATS with the experimental "header_rewrite" plugin when reading 406 response from IIS .  (You can have a try. I did't test it and don't know if the plugin build well on your 3.0.4 environment.)

ref:
https://github.com/apache/trafficserver/tree/master/plugins/experimental/header_rewrite
https://github.com/apache/trafficserver/blob/master/plugins/experimental/header_rewrite/Examples/YCS-EC

Re: 406 responses being cached

Posted by Conan <co...@gmail.com>.
On Thu, Apr 4, 2013 at 2:44 AM, Brendan Webb <we...@ohsu.edu> wrote:

> I'm running ATS 3.0.4 in front of IIS 7.5.
>
> Is there a way to tell ATS not to cache 406 responses?
>

AFAIK, if you can add a "Cache-Control: no-cache" header on IIS for 406
response, ATS will not cache it.

If unable to configure on IIS, you can try to add that header on ATS with
the experimental "header_rewrite" plugin when reading 406 response from
IIS .  (You can have a try. I did't test it and don't know if the plugin
build well on your 3.0.4 environment.)

ref:
https://github.com/apache/trafficserver/tree/master/plugins/experimental/header_rewrite
https://github.com/apache/trafficserver/blob/master/plugins/experimental/header_rewrite/Examples/YCS-EC