Skip to content

Commit

Permalink
Update timing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwalton committed Apr 12, 2024
1 parent d2fb0ae commit 51213c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
17 changes: 9 additions & 8 deletions README.md
Expand Up @@ -1022,26 +1022,27 @@ interface LCPAttribution {
#### TTFB `attribution`:

```ts
interface TTFBAttribution {
export interface TTFBAttribution {
/**
* The total time from when the user initiates loading the page to when the
* page starts to handle the request. This is mostly redirect time but may
* contain browser processing time so may be non-zero even without redirects.
* page starts to handle the request. Large values here are typically due
* to HTTP redirects, though other browser processing contributes to this
* duration as well (so even without redirect it's generally not zero).
*/
waitingDuration: number;
/**
* The total time spent checking the HTTP cache for a match. For navigations
* using service workers this time represents the total service worker time.
* the handled via service worker, this time usually includes the service
* worker start-up time as well as time processing `fetch` event listeners,
* with some exceptions: https://github.com/w3c/navigation-timing/issues/199
*/
cacheDuration: number;
/**
* The total time to resolve the DNS for the requested domain. This cannot
* be measured for requests using service workers and will be 0.
* The total time to resolve the DNS for the requested domain.
*/
dnsDuration: number;
/**
* The total time to create the connection to the requested domain. This
* cannot be measured for requests using service workers and will be 0.
* The total time to create the connection to the requested domain.
*/
connectionDuration: number;
/**
Expand Down
19 changes: 12 additions & 7 deletions src/types/ttfb.ts
Expand Up @@ -28,27 +28,32 @@ export interface TTFBMetric extends Metric {
* An object containing potentially-helpful debugging information that
* can be sent along with the TTFB value for the current page visit in order
* to help identify issues happening to real-users in the field.
*
* NOTE: these values are primarily useful for page loads not handled via
* service worker, as browsers differ in what they report when service worker
* is involved, see: https://github.com/w3c/navigation-timing/issues/199
*/
export interface TTFBAttribution {
/**
* The total time from when the user initiates loading the page to when the
* page starts to handle the request. This is mostly redirect time but may
* contain browser processing time so may be non-zero even without redirects.
* page starts to handle the request. Large values here are typically due
* to HTTP redirects, though other browser processing contributes to this
* duration as well (so even without redirect it's generally not zero).
*/
waitingDuration: number;
/**
* The total time spent checking the HTTP cache for a match. For navigations
* using service workers this time represents the total service worker time.
* the handled via service worker, this time usually includes the service
* worker start-up time as well as time processing `fetch` event listeners,
* with some exceptions: https://github.com/w3c/navigation-timing/issues/199
*/
cacheDuration: number;
/**
* The total time to resolve the DNS for the requested domain. This cannot
* be measured for requests using service workers and will be 0.
* The total time to resolve the DNS for the requested domain.
*/
dnsDuration: number;
/**
* The total time to create the connection to the requested domain. This
* cannot be measured for requests using service workers and will be 0.
* The total time to create the connection to the requested domain.
*/
connectionDuration: number;
/**
Expand Down

0 comments on commit 51213c2

Please sign in to comment.