为什么请求缓存的到期日期是过去的?
Why does the expiration date of the request cache lie in the past?
我正在缓存一些页面,我在 Firebug 中注意到了这一点:
所以它说缓存在 45 年前就过期了。这是错误还是某些错误数据?
我有另一个正确缓存的页面
就是不明白为什么要说Expires ... 1970
。即使我在 Drupal 中使用 Boost 模块,此页面也不会缓存在我的网站上。
如果 Expires
header 设置为 0
,浏览器将其解释为 1970 年 1 月 1 日,这与 Unix time aka POSIX time 相关。因为这个日期是过去的,这意味着请求没有被缓存。
Expires
header 是defined within RFC 7234,其中包括与上面声明相关的这段话:
A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired").
我正在缓存一些页面,我在 Firebug 中注意到了这一点:
所以它说缓存在 45 年前就过期了。这是错误还是某些错误数据?
我有另一个正确缓存的页面
就是不明白为什么要说Expires ... 1970
。即使我在 Drupal 中使用 Boost 模块,此页面也不会缓存在我的网站上。
如果 Expires
header 设置为 0
,浏览器将其解释为 1970 年 1 月 1 日,这与 Unix time aka POSIX time 相关。因为这个日期是过去的,这意味着请求没有被缓存。
Expires
header 是defined within RFC 7234,其中包括与上面声明相关的这段话:
A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired").