哪些浏览器支持 stale-if-error 和 stale-while-revalidate?
Which browsers support stale-if-error and stale-while-revalidate?
RFC 5861 proposes the Cache-Control
extensions stale-while-revalidate
:
When present in an HTTP response, the stale-while-revalidate Cache-
Control extension indicates that caches MAY serve the response in
which it appears after it becomes stale, up to the indicated number
of seconds.
The stale-if-error Cache-Control extension indicates that when an
error is encountered, a cached stale response MAY be used to satisfy
the request, regardless of other freshness information.
当无法重新验证响应时,允许陈旧内容使用更长时间。
这些是supported by CDNs, including Fastly and KeyCDN。
stale-while-revalidate
也是 mentioned in the Fetch standard(stale-if-error
不是)。
浏览器的支持情况如何?
截至 2019 年 5 月,根据 Mozilla and Chrome 的兼容性表,stale-while-revalidate
为:
这些将分别是 2019-07-09 and 2019-06-09 上这些浏览器的主要版本。
stale-if-error
似乎没有当前或计划中的支持。
(有关 为什么 在浏览器中实现此功能的更多详细信息,请参阅 RFC 作者的博客 Chrome and Stale-While-Revalidate。)
RFC 5861 proposes the Cache-Control
extensions stale-while-revalidate
:
When present in an HTTP response, the stale-while-revalidate Cache- Control extension indicates that caches MAY serve the response in which it appears after it becomes stale, up to the indicated number of seconds.
The stale-if-error Cache-Control extension indicates that when an error is encountered, a cached stale response MAY be used to satisfy the request, regardless of other freshness information.
当无法重新验证响应时,允许陈旧内容使用更长时间。
这些是supported by CDNs, including Fastly and KeyCDN。
stale-while-revalidate
也是 mentioned in the Fetch standard(stale-if-error
不是)。
浏览器的支持情况如何?
截至 2019 年 5 月,根据 Mozilla and Chrome 的兼容性表,stale-while-revalidate
为:
这些将分别是 2019-07-09 and 2019-06-09 上这些浏览器的主要版本。
stale-if-error
似乎没有当前或计划中的支持。
(有关 为什么 在浏览器中实现此功能的更多详细信息,请参阅 RFC 作者的博客 Chrome and Stale-While-Revalidate。)