[blink-dev] Intent to Prototype: Back/forward cache NotRestoredReason API

264 views
Skip to first unread message

Yuzu Saijo

unread,
May 9, 2022, 11:13:47 PM5/9/22
to blin...@chromium.org, bfcache-dev

Contact emails

yu...@chromium.org, fer...@chromium.org


Explainer

https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md


Specification

(Not yet ready)


Summary

NotRestoredReason API will report the list of reasons why a page is not served from BFcache in a frame tree structure, via PerformanceNavigationTiming API (and Reporting API in the future).



Blink component

UI>Browser>Navigation>BFCache


Motivation

Today pages can be blocked from BFCache for different reasons, such as reasons required by spec and reasons specific to the browser implementation. 


For example, if a page uses a feature such as WebLock and does not release the acquired lock in the pagehide handler, Chrome does not put the page into BFCache. If developers want to make their site restored from BFCache, they have to release the lock in the pagehide handler.


Developers can gather the hit-rate of BFCache on their site, i.e. what % of history navigation is served by BFCache, by using the pageshow handler persisted parameter and PerformanceNavigationTiming.type(back-forward). However, there is no way for developers to tell what reasons are blocking their pages from BFCache in the wild. They are not able to know what actions to take to improve the hit-rate.


We would like to make it possible for sites to collect information on why BFCache is not used on a history navigation, so that they can take actions on each reason and make their page BFCache compatible.




Initial public proposal

https://github.com/whatwg/html/issues/7094

https://discourse.wicg.io/t/proposal-back-forward-cache-notrestoredreason-api/5773


TAG review

(Not sent yet)


Risks



Interoperability and Compatibility



Gecko: Positive feedback on the GitHub discussion (link)


WebKit: No signal


Web developers: 

Positive reactions in W3C WG presentation (minutes)

Performance Navigation API GitHub thread (link)

Positive reactions in TPAC WebPerf WG (minutes)




Debuggability



Is this feature fully tested by web-platform-tests?

No


Flag name

(Not yet ready)



Requires code in //chrome?

False


Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5684908759449600



Reply all
Reply to author
Forward
0 new messages