Joe
Joe

Reputation: 31095

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.

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?

Upvotes: 2

Views: 3857

Answers (1)

Joe
Joe

Reputation: 31095

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

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.)

Upvotes: 2

Related Questions