mod_expires sending Cache-Control headers for 3## status codes
Asked Answered
O

1

8

Apache is sending Cache-Control headers for 3## status codes, like 302 redirects. This is causing Firefox (possibly starting with Firefox 5) to cache the 302 redirects--which results in an infinite redirect loop for some of my pages.

Here are the settings that I am using in my httpd.conf:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
</IfModule>

If I remove the ExpiresDefault setting, the problem goes away, so I am confident that this is the exact setting that is causing the problem. If I change ExpiresDefault A600 to ExpiresByType text/html A600 the problem is still there.

I'd like to have browsers cache my content by default, but this is a deal-breaker.

Are there any settings I can use to tell Apache to send a different Cache-Control header for 3## status codes?

Ours answered 1/8, 2011 at 20:44 Comment(0)
D
0

If you add the Cache-Control headers in your application, which builds the redirect, apache will not overwrite it.

Cache-Control: max-age=0
Expires: Sat, 04 Feb 2012 07:02:38 GMT

if you use apaches mod_rewrite to do the redirect you could add the headers with the mod_headers module.

Diapositive answered 4/2, 2012 at 7:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.