Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split waitingDuration to make it easier to understand redirect delays #458

Merged
merged 29 commits into from Apr 12, 2024

Conversation

tunetheweb
Copy link
Member

@tunetheweb tunetheweb commented Apr 3, 2024

Fixes #395

This splits waitingDuration (formerly known as waitingTime in v3) into two:

  • waitingDuration - which the time until (workerStart or fetchStart). This will mostly be redirect time but I've avoided explicitly calling that as redirectStart/End can't be used and it's easy to see when testing instances where looking at workerStart or fetchStart still leaves a non-0 amount of time that is not redirects.
  • cacheDuration which is the time from then until domainLookupStart. This will mostly be HTTP cache time, except for service-worker controlled sites when it will be service worker time.

See PerformanceNavigationTiming breakdown for more context:
image

As part of this I've also moved any delays between connectEnd and requestStart from being attributed to connectionDuration (i.e before the delay) to requestDuration (i.e after the delay). This helps avoiding attributing this delay to connectionDuration for service-worker controlled sites when this should be 0, but without adding an extra breakdown that would not be that useful.

README.md Outdated Show resolved Hide resolved
docs/upgrading-to-v4.md Outdated Show resolved Hide resolved
src/attribution/onTTFB.ts Outdated Show resolved Hide resolved
src/attribution/onTTFB.ts Outdated Show resolved Hide resolved
test/e2e/onTTFB-test.js Outdated Show resolved Hide resolved
test/e2e/onTTFB-test.js Outdated Show resolved Hide resolved
src/types/ttfb.ts Outdated Show resolved Hide resolved
@tunetheweb tunetheweb changed the title Redirect duration Split waitingDuration to make it easier to understand redirect delays Apr 12, 2024
@tunetheweb tunetheweb changed the title Split waitingDuration to make it easier to understand redirect delays Split waitingDuration to make it easier to understand redirect delays Apr 12, 2024
src/attribution/onTTFB.ts Outdated Show resolved Hide resolved
src/attribution/onTTFB.ts Show resolved Hide resolved
@philipwalton philipwalton merged commit da10e5a into v4 Apr 12, 2024
6 checks passed
@philipwalton philipwalton deleted the redirect-duration branch April 12, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants