w3c / navigation-timing

Navigation Timing
https://w3c.github.io/navigation-timing/
Other
116 stars 30 forks source link

a bit confused with the "Redirect" timing in Time Navigation #132

Closed ThierryMajutec closed 3 years ago

ThierryMajutec commented 3 years ago

In the time navigation timeline, redirect occurs before any request on the network (DNS, TCP/TLS establishment,...). But if I surf a site and receive a status code 3xx to redirect my request, it means that I've established a TCP connection to this server.

So what does the redirect part of the time navigation take into account ?

nicjansma commented 3 years ago

You're correct, in the case of same-site redirections, the "cost" of the initial DNS and TCP will likely be as part of the first request, whose timestamps get reduced into just the the duration of redirectEnd-redirectStart.

Since the DNS and TCP are likely re-used for those same-site redirections, the "final" request (that's reported in the other NavigationTiming timestamps) will likely have its DNS and TCP durations be 0-ish (e.g. domainLookupEnd-domainLookupStart=0)

ThierryMajutec commented 3 years ago

You're correct, in the case of same-site redirections, the "cost" of the initial DNS and TCP will likely be as part of the first request, whose timestamps get reduced into just the the duration of redirectEnd-redirectStart.

Since the DNS and TCP are likely re-used for those same-site redirections, the "final" request (that's reported in the other NavigationTiming timestamps) will likely have its DNS and TCP durations be 0-ish (e.g. domainLookupEnd-domainLookupStart=0)

Thanks ! This is indeed what I think, but are we sure this is the case ?

nicjansma commented 3 years ago

In practice, this is what we see in RUM data. Feel free to share any examples if you see differently!

nicjansma commented 3 years ago

I believe we've addressed this question, but please leave a comment if there's anything else!