Going back and forward in Google Chrome will get a lot faster with bfcache

Google Chrome is the world’s most popular web browser, both on mobile and on the desktop. Over the years, it has faced its fair share of criticism for being more memory-intensive than it needs to be and getting bloated in terms of size and features, but it has also received praise for its real-world speed and usability. Now, Google has announced that it is working on a new feature to improve back-forward navigation in the web browser, using bfcache (backward-forward cache).

Google states that a back/forward cache (bfcache) caches whole pages, including the JavaScript heap, when navigating away from a page. This is done so that the full state of the page can be restored when the user navigates back. The company gives an analogy of pausing a page when the user leaves it and playing it when the user returns. It will work when navigating back as well as when navigating forward to a previously accessed page.

Google notes that this feature won’t help when visiting new websites. That doesn’t mean it won’t be useful, though. According to the company, going back accounts for 19% of pages viewed on Google Chrome for Android and 10% on Chrome for PC. bfcache will make that navigation “extremely fast,” according to Google. It’s definitely not a trivial endeavor to implement, the company notes.

Mozilla Firefox and Apple Safari have subtly different implementations of this caching technology, Google notes. Chrome, however, is opting not to use WebKit’s implementation of bfcache due to incompatibility with Chrome’s multi-process architecture.

Addy Osmani, an engineering manager on the Chrome team, told CNET that the tricky part for Chrome is rewriting some parts of the browser to protect privacy and security. Google’s web browser has to make sure that it stops web-based JavaScript programs from running even though it’s hanging on to them in memory. He acknowledged that running JavaScript on pages which are not there from a user’s perspective is “a big potential privacy problem,” and therefore, the company is going to change Chrome’s architecture to ensure that the privacy problem won’t occur.

The downside? bfcache won’t be available on Chrome anytime soon. Google hopes to test bfcache in 2019 and build it into Chrome in 2020, according to Mr. Osmani.

Another constraint is that saving the state of web pages for possible later use will consume memory, which is already one of the major issues that Chrome faces. Mr. Osmani stated that Google is still trying to figure out the best rules for deciding which pages to keep around when to dump them from memory. He also said that the feature could help with other situations, such as better performance for tabs that need to be paused while they are on the background, particularly on mobile. Such a situation usually leads to saved memory, but it also has a major downside as pages have to be reloaded after returning to them.

bfcache on Chrome definitely sounds promising, but it’s in the early stages so far. We expect to learn more it in the coming months.


Source: GoogleVia: CNET



Comments

Popular posts from this blog

Honor 20 Pro is Now Available in 14 Countries

Motorola’s foldable Razr phone may be announced before year’s end

Behind Dynamic System Updates in Android Q: How Google is using Project Treble to improve future Android releases