If a response includes both an Expires header and a max-age directive, the max-age directive overrides the Expires header, even if the Expires header is more restrictive
似乎 mod_expires 和 mod_headers 在我的服务器中都处于事件状态。
其中哪一个更可取,您能评论一下它们各自的优点吗?
谢谢你。
最佳答案
您可能只想使用 mod_expires,因为这允许自动发送 Cache-Control header 和 Expires header ,并且可以允许您指定访问时间和文件修改时间。它还允许您按文件类型设置不同的默认值。
使用 mod_expires 您可以使用以下指令设置默认到期时间:
ExpiresDefault "access plus 2 days"
当然 mod_headers 是一个更通用的模块,它允许您做一些相同的事情,但通常更多地用于创建自定义标题或管理多个(可能是冲突的)标题。
关于apache - mod_expires 还是 mod_headers?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12164684/