【问题标题】:How can I make browsers cache html files?如何让浏览器缓存 html 文件?
【发布时间】:2021-07-29 18:47:03
【问题描述】:

我希望浏览器缓存 html 文件。我设置了Apache2.4,确认缓存了css、js、png,但是从来没有缓存过html文件。

Chrome 90 和 Edge 90
阿帕奇 2.4

/etc/httpd/conf/httpd.conf

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 30 days"
</IfModule>

【问题讨论】:

    标签: apache google-chrome microsoft-edge browser-cache cache-control


    【解决方案1】:

    您好尝试添加 ExpiresByType 文本/html“访问加 7200 秒”。希望它有效!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-21
      • 2017-09-18
      • 2012-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-09
      • 2014-01-25
      相关资源
      最近更新 更多