navigation-timing
navigation-timing copied to clipboard
Extend Navigation Timing API to include back/forward cache NotRestoredReasons
In TPAC 2021, we had a positive feedback on reporting back/forward cache NotRestoredReasons extending Navigation Timing API. e.g. Exposing why a page is not restored from back/forward cache in Navigation Timing API. link to WG minutes
Here is the explainer: NotRestoredReason Explainer
Our proposal on how to propose NotRestoredReasons is below:
var perfEntries = performance.getEntriesByType("navigation");
for (var i=0; i < perfEntries.length; i++) {
console.log("= Navigation entry[" + i + "]");
var p = perfEntries[i];
// p.notRestoredReason == [{URL:"a.com", Id: "x", blocked: True, reasons:["broadcast channel"], children:[]}]
}
Please let me know if you have any feedback on this. Thanks!
/cc @nicjansma @cliffcrocker @danshappir @achristensen07 @sbougonSF @bdekoz @sefeng211 for opinions
This looks great! It seems like it would be a relatively simple addition to our RUM library. The only feedback so far from SpeedCurvers is related to the explainer. While it's fantastic to see the definitions and the 'how to fix' section is refreshing, there is concern about how maintainable this will be. We'd love to see a machine readable source for such things in the future.
Thanks for the comment! Do you think linking to the web.dev article will help? We have detailed examples of how to fix some of the blocking reasons, though not covering all: article link
Please let me know what kind of format would be helpful. Thanks!
I think this will be a great thing for RUM providers to report on. We would integrate this into boomerang.js once available!