-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(time-to-first-byte): use receiveHeadersStart #15126
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good. Should we update the usages of receiveHeadersEnd
in server-reponse-time.js
and network-analyzer.js
as well?
As the Without considering the current state of the audit, I'd consider "server response" to be pretty ambiguous, you could argue it can be the first byte of the headers or the first byte of the response body. I don't have a good argument for one way or the other, except that: if it was meant to be the first byte of the headers, why wasn't the audit called TTFB?
|
Let's defer the network analyzer changes until after we update the Lantern database. #15150 |
According to this comment, server response time is just one part of TTFB: lighthouse/core/lib/dependency-graph/simulator/network-analyzer.js Lines 227 to 228 in 333a667
|
Yeah, TTFB is Server response time tries to measure the end of that duration from when the first request byte is sent (
|
Thanks for the breakdown @brendankenny! I'll prepare another PR to update |
What other uses are there? Would it be helpful to make a tracking bug to make sure they all get moved over? |
Analyzer is the only other one, and that is tracked here #15150 |
I added
receiveHeadersStart
to network timings in https://chromium-review.googlesource.com/c/chromium/src/+/4556570 . It will be available in M116.This PR changes ttfb calculation to use
timing.receiveHeadersStart
instead oftiming.receiveHeadersEnd
. Using the end time potentially misreports ttfb in uncommon cases where the server either intentionally delays some headers (say, it push out some link headers early then does the rest after some thinking); or sends so many headers that they arrive over multiple packets. In either case, we care about the network connection latency, so we want to exclude such delays.