Which browsers support stale-if-error and stale-while-revalidate?

青春壹個敷衍的年華 提交于 2021-02-05 12:13:59

问题


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.

and stale-if-error:

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.

to allow stale content to be used for longer when a response cannot be revalidated.

These are supported by CDNs, including Fastly and KeyCDN.

stale-while-revalidate is also mentioned in the Fetch standard (stale-if-error is not).

What is the state of support in browsers?


回答1:


As of May 2019, according to the compatibility tables of Mozilla and Chrome, stale-while-revalidate is:

  • supported in the beta releases of Firefox 68 (tracking)
  • due to be supported in Chrome 75 (tracking)

These will be the main releases of those browsers on 2019-07-09 and 2019-06-09 respectively.

stale-if-error doesn't appear to have current, or planned, support.

(See the RFC author's blog Chrome and Stale-While-Revalidate for more detail on why to implement this in browsers.)



来源:https://stackoverflow.com/questions/56196238/which-browsers-support-stale-if-error-and-stale-while-revalidate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!