Apache 正在发送 3## 状态代码的 Cache-Control header ,例如 302 重定向。这导致 Firefox(可能从 Firefox 5 开始)缓存 302 重定向——这导致我的某些页面出现无限重定向循环。
这是我在 httpd.conf
中使用的设置:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A600
</IfModule>
如果我删除 ExpiresDefault 设置,问题就会消失,所以我确信这是导致问题的确切设置。如果我改变
ExpiresDefault A600
至ExpiresByType text/html A600
问题仍然存在。我想让浏览器默认缓存我的内容,但这会破坏交易。
我可以使用任何设置来告诉 Apache 为 3## 状态代码发送不同的 Cache-Control header 吗?
最佳答案
如果您在构建重定向的应用程序中添加 Cache-Control header ,则 apache 不会覆盖它。
Cache-Control: max-age=0
Expires: Sat, 04 Feb 2012 07:02:38 GMT
如果您使用 apaches mod_rewrite 进行重定向,您可以添加带有
mod_headers模块。
关于apache - mod_expires 为 3## 状态码发送 Cache-Control header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6904215/