【问题标题】:Does it matter in which order the cache headers are sent?发送缓存标头的顺序是否重要?
【发布时间】:2014-06-12 18:16:14
【问题描述】:

各种来源都提到了使用标头控制缓存的不同方法:

Expires: Sun, 01 Jan 2014 00:00:00 GMT'

Cache-Control: no-store, no-cache, must-revalidate

Cache-Control: post-check=0, pre-check=0

我想知道的是:这些标头的优先顺序是什么?假设我将“Exprires”设置为 1 天后,其他标题会怎样?他们会覆盖 Exprires 标头吗?

这些标头的发送顺序也有关系吗?

【问题讨论】:

    标签: php http


    【解决方案1】:

    “Cache-Control”优先于“Expires”。 (来源:http://www.kaizou.org/2009/02/http-caching-explained/

    HTTP 标头顺序在here 中进行了解释。 “Expires”和“Cache-Control”标头可以按任意顺序出现,两个“Cache-Control”值也可以合并到一个标头中:

    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    

    【讨论】:

      猜你喜欢
      • 2010-10-19
      • 2015-07-28
      • 2015-04-17
      • 2015-12-01
      • 2017-08-09
      • 1970-01-01
      • 2012-02-07
      相关资源
      最近更新 更多