Warm tip: This article is reproduced from stackoverflow.com, please click
back browser browser-cache

Which browsers have a back-forward cache? (a bfcache keeps modifications to DOM)

发布于 2020-05-09 13:51:00

Which browsers nowadays support a back-forwards cache (bfcache)?

A back-forwards cache is a browser's in-memory cache that is used when a user clicks the back button and the forward button. It stores the state of the page as it was when the user navigated away, so any changes made to the DOM should be loaded instantly.

Note that this is different from the normal caching mechanisms that all browsers have. A bfcache applies specifically when a user clicks the back button, and can handle dynamic changes in the DOM.

The only information I can find about this bfcache is years old, referencing Firefox 1.5. Do modern browsers support it? Where can I find information about it?

Questioner
Flimm
Viewed
134
Flimm 2020-05-04 15:19

Firefox: yes

Firefox supports a back-forwards cache, you can find details here:

Note that the bfcache does work in newer Firefox versions like version 75, despite how old the documentation is. Note that it is easy for pages and for extensions to deactivate the bfcache by accident. I found that I had an extension installed that deactivated the bfcache on all pages.

Safari: yes, but not HTTPS?

With regards to Safari, all I can find is this article:

This article states that the Page Cache (its name for the back-forwards cache) is disabled on all pages that use HTTPS, which in today's web, is a large portion of them.

Chrome: not yet

Chrome does not support a back-forwards cache. However, their developer team announced that they are exploring adding this feature to Chrome:

See chromestatus for this feature.