Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which browsers support "Cache-control: immutable"?

Tags:

I've read that Firefox has begun supporting a cache control extension value of immutable, which means that "the response body will not change over time." So even if a user requests a "full refresh" of a page or resource, the browser still only responds with the locally cached copy, thus avoiding unnecessary 304s or page refreshes, and making pages load faster since cached content is used, and decreasing load on servers, since a large number of requests are stopped before they even happen.

I'm trying to see how well this is supported, and am finding varying answers, as this mozilla page suggests that it's only supported in Firefox, but this resolved Chrome issue suggests it's been available since Chrome v54.

Which browsers support Cache-Control: immutable, and when did they start supporting it?

I first read about it here on this Hacker News discussion

Here's an ietf draft on it, the original mozilla post announcing this beta feature being used by Facebook and this related mozilla post, and a document discussing the different types of reloading requests from some Google chrome devs, it appears.

like image 340
Brad Parks Avatar asked Jan 30 '17 13:01

Brad Parks


People also ask

What is Cache-Control immutable?

What is Cache-Control: immutable ? # The Cache-Control: immutable directive was first introduced in Firefox 49 to provide the browser with hints as to which resources never change.

Do browsers share cache?

The browsers do not share a cache, but plugins might. Like Adobe Flash keeps cross-browser history and "local shared objects", which can be used in a cookie-like way. Clearing a cache in a browser usually does not remove the information stored by such plugin.

How does cache work in browser?

The basic idea behind it is the following: The browser requests some content from the web server. If the content is not in the browser cache then it is retrieved directly from the web server. If the content was previously cached, the browser bypasses the server and loads the content directly from its cache.


1 Answers

As of February 2017, Cache-Control: immutable is supported by

  • Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1267474) since Firefox 49
  • Chrome (https://bugs.chromium.org/p/chromium/issues/detail?id=611416) since Chrome 54 They aren't implementing this.
  • Safari (https://bugs.webkit.org/show_bug.cgi?id=167497) in Safari Technology Preview 24.

It is also listed on MDN and Can I Use ... ?.

like image 68
Joe Avatar answered Sep 28 '22 01:09

Joe