Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 527
Flimm Avatar asked Feb 24 '20 19:02

Flimm


1 Answers

Firefox: yes

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

  • Using Firefox 1.5 (back-forwards) caching
  • Working with BFCache (in Firefox)

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:

  • WebKit Page Cache I – The Basics (2009) from webkit.org

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: yes

According to this web.dev article from Google, Chrome does support this feature:

Starting in version 86, Chrome enabled bfcache for cross-site navigations on Android for a small percentage of users. In subsequent releases, additional support slowly rolled out. Since version 96, bfcache is enabled for all Chrome users across desktop and mobile.

See chromestatus for this feature.

like image 106
Flimm Avatar answered Oct 31 '22 06:10

Flimm