On Thu, Dec 5, 2013 at 12:22 AM, Christian HUTTER <[email protected]>wrote:
> Leif, > > > > Thank you for your answer. Modifying the redirect did work. But I couldn’t > find out why ATS is doing this. I’m running more or less the standard > configuration. > > > > > > Christian > > > > *From:* Leif Hedstrom [mailto:[email protected]] > *Sent:* Wednesday, December 04, 2013 11:11 PM > *To:* [email protected] > *Subject:* Re: Caching Problem > > > > On Dec 4, 2013, at 2:31 AM, Christian HUTTER <[email protected]> > wrote: > > > > Dear All, > > > > I’m facing a caching problem with our ATS 3.2.4 installation and hope > someone here can point me into the correct direction. We are using ats as > reverse caching proxy for a variety of web sites. One of those sites does a > redirection based upon the user agent of the client (the goal is to give > users of mobile devices a specific site access). As soon as I enable > caching for these sites the following happens. Once a mobile device > accesses the site the device is (correctly) redirected to the mobile > version of the web site. If now a desktop based client accesses the same > site it seems as if the redirect is cached so also the desktop client is > sent to the mobile site as well. Is there a way to not cache redirects? > > > > Well, by default redirects aren’t cacheable afaik. If you want to be sure > the redirect isn’t cacheable, just have your origin inject a Cache-Control: > max-age=0,no-store or some such. Also check your configs to get some > ideas as to if and why it’s caching the redirects. > > On 4.1.1, I'm seeing both 301 and 302 redirects getting cached, if they've been sent by the origin with Expires+Cache-Control headers (kind of annoying that Apache isn't disabling ExpiresActive for redirects, but that's another story), even with proxy.config.http.cache.allow_empty_doc=0. Though apache is by default also adding a chunk of content anyway describing the redirect, so it wouldn't be empty anyway. Doesn't seem to be influenced at all by the negative caching settings either.
