Home > other >  Does TTFB include the time for the request that redirects to my page?
Does TTFB include the time for the request that redirects to my page?

Time:09-18

I am calculating TTFB (Time to First Byte) and other web vitals on a page using the web-vitals javascript library.

The flow is like this:

  1. The user, looking at a web page from server A, is clicking a button or other link, resulting in a request that goes to server A.
  2. Server A analyses the request and returns a redirect, probably 303, with the link to my page, that is on server B.
  3. The browser is redirected to my page on server B, that is loaded with the content.

In my page on server B, I measure TTFB.

Will the TTFB I measure include the time it took to get the redirect from server A?

CodePudding user response:

Yes, Navigation Timing Level 2 image showing TTFB from the navigation start time of prompt for unload to the response start time.

Borrowing a graphic from the Navigation Timing spec, TTFB is represented by the stages in the red box above.

  • Related