Mod_expires sends Cache-Control headers for status codes 3 ##

Apache sends Cache-Control headers for status codes 3 ##, such as 302 redirects. This causes Firefox (possibly starting with Firefox 5) to cache 302 redirects, which leads to an endless redirect cycle for some of my pages.

Here are the settings I use in my httpd.conf :

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

If I remove the ExpiresDefault parameter, the problem will disappear, so I'm sure this is the exact setting causing the problem. If I change ExpiresDefault A600 to ExpiresByType text/html A600 , the problem still exists.

I would like browsers to cache my content by default, but this is unlocking.

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

+6
source share
1 answer

If you add the Cache-Control headers to your application that creates the redirect, apache will not overwrite it.

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

if you use apache mod_rewrite to do the redirection, you can add headers using mod_headers .

0
source

Source: https://habr.com/ru/post/894061/


All Articles