【问题标题】:mod_expires sending Cache-Control headers for 3## status codesmod_expires 为 3## 状态码发送 Cache-Control 标头
【发布时间】:2011-10-17 18:25:04
【问题描述】:

Apache 正在发送 3## 状态代码的 Cache-Control 标头,例如 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 标头吗?

【问题讨论】:

    标签: apache redirect cache-control browser-cache mod-expires


    【解决方案1】:

    如果您在构建重定向的应用程序中添加 Cache-Control 标头,则 apache 不会覆盖它。

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

    如果您使用 apaches mod_rewrite 进行重定向,您可以添加带有 mod_headers 模块。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-13
      • 2010-11-13
      • 2019-09-19
      • 2014-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多