navigation-timing icon indicating copy to clipboard operation
navigation-timing copied to clipboard

Extending the NavigationTimingType

Open tunetheweb opened this issue 1 year ago • 5 comments

Related to the discussion on #179

There are a few uses cases where the NavigationTimingType does not cover the type:

  • Restores - can be detected with document.wasDiscarded. Should we add a restore navigation type rather than reuse the original navigation type?
  • BFcache usage - it's arguable whether this is a "navigation", but given pages that are not in bfcache will reload, and that counts as back_forward navigation, I argue BFcache restores should be a navigation. Currently this can be detected with the persisted flag on the pageshow event. Should we add a back_forward_cache navigation type, and treat this is as a true navigation, to explicitly make it easier to identify these?
  • Prerender - this is explicitly noted in the spec as for the Resource Hint, but is currently being reimplemented in Chrome using the Speculation rules API, and the omnibox which does not fit this definition. Should the wording be relaxed to include all prerenders?
  • Additionally the prerender option is not listed in the interace, when it should be shouldn't it?

These types, can have very different performance measurements compared to other navigations and it is often recommended to measure them separately, but at the moment, this results in lots of extra code for (for example) and understanding of all these nuances to enable this.

There's a lot of different issues in this one, so happy to split this out, or continue some of the discussion in #179 but thought I'd start with the one issue for now in case we wanted to tackle together.

tunetheweb avatar Nov 08 '22 10:11 tunetheweb