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

Report that Critical-CH was used to restart a navigation

Open yoavweiss opened this issue 2 years ago • 1 comments

Chromium recently got a report that it's hard for folks deploying Critical-CH as a backup mechanism to ACCEPT_CH frames to know if/when that backup was actually used, and triggered a restart of the navigation (which is likely to result in user-visible delay)

It may make sense for us to report that as part of navigation timing. This somehow connects to other "types" of navigations that we're considering reporting, so it may make sense to find an API shape that doesn't require a separate attribute per type.

yoavweiss avatar Apr 20 '22 10:04 yoavweiss

Discussed on Apr 28 WebPerf WG call: https://w3c.github.io/web-performance/meetings/2022/2022-04-28/index.html

Summary:

  • It seems fine to expose prefetch and Critical-CH signals orthogonally.

nicjansma avatar May 11 '22 14:05 nicjansma

From my testing, it looks like a Critical-CH-restarted navigation (in Chrome today) extends the requestStart to responseStart timestamps.

In other words, if the server takes +1 second to respond to the second request for the navigated resource (having restarted because a Critical-CH requested a hint that wasn't sent on the first request), responseStart will be at least 1 second after requestStart.

As we approach wider deployments of Client Hints for Chrome and the User-Agent Reduction timeline, I'd like to see if we can get this information into NavigationTiming. RUM providers could capture this information to help inform their customers about how effective UACH/UAR deployments and changes are, and to highlight any potentially costly restarted-navigations from Critical-CH.

A boolean flag for a Critical-CH-restarted request seems the easiest to implement. Ultimately if we get closer to https://github.com/w3c/navigation-timing/issues/37 and https://github.com/w3c/resource-timing/issues/21 it would be nice to have a breakdown of both requests in the NT data, but I'd take a boolean for now.

I'm not sure if there are any other impacts from UACH/UAR that we'd want to measure/report on, so pondering that 🤔

nicjansma avatar Mar 17 '23 13:03 nicjansma

^^ @arichiv @miketaylr

yoavweiss avatar Mar 17 '23 13:03 yoavweiss

I can see how this could be useful. WDYT, @arichiv?

miketaylr avatar Mar 17 '23 14:03 miketaylr

Makes sense to me, I can propose this and try to get it in M114.

arichiv avatar Mar 17 '23 14:03 arichiv