代码之家  ›  专栏  ›  技术社区  ›  Keith Bentrup

哪些缓存标头阻止浏览器向服务器请求最后修改日期?

  •  1
  • Keith Bentrup  · 技术社区  · 16 年前

    <ifmodule mod_expires.c>
      <filesmatch "\.(jpg|gif|png|css|js|swf)$">
       ExpiresActive On
       ExpiresDefault "access plus 10 years"
       </filesmatch>
    </ifmodule>
    

    1 回复  |  直到 16 年前
        1
  •  1
  •   Philippe Leybaert    16 年前

    您还可以添加:

    Cache-Control: public
    

    在.htaccess中:

       <filesmatch "\.(jpg|gif|png|css|js|swf)$">
           Header set Cache-Control "max-age=1000000000, public"
       </filesmatch>