What is fetchStart?
- The metric fetchStart is a recorded moment in time where the browser first attempts to retrieve a document.
- fetchStart may be used as the beginning timestamp upon which other performance metrics are measured.
Okay, fetchStart is the start time of a fetch, but what exactly is a fetch?
We play fetch with our dogs right?
Let's use that to illustrate what a fetch is. The fetch is where the dog runs after the ball, gets it, and then brings it to us.
To measure the dog fetch time, we have to decide where the fetch began and ended. It would kind of be unfair to judge the dog on the time you took to throw the ball right? Those teasing moments of you saying "Wanna play fetch?, wanna play fetch?", well those shouldn't count either.
What should count is the time the dog took to go get the ball.
Much in the same way, fetchStart does not incude redirect time, unloading of the prior document or other things.
In dog terms fetchStart is the moment the dog starts running after the ball.
How fetchStart is calculated by a browser
According to the Navigation Timing API specification 1 fetchStart is defined as...
"If the new resource is to be fetched using HTTP GET or equivalent, fetchStart must return the time immediately before the user agent starts checking any relevant application caches. Otherwise, it must return the time when the user agent starts fetching the resource."
It is also interesting to note that fetchStart can share the same value as many other metrics. Again from the specification...
What is fetchStart used for?
An example use of fetchStart would be measuring network latency.
Combined with other values from the Navigation Timing API we could find out network latency using....
The metric fetchStart, much like the metric navigation start, allows more accurate timing measurements by defining the start point of an action.