PerformanceResourceTiming interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an
<SVG>, image, or script.
The interface's properties create a resource loading timeline with
high-resolution timestamps for network events such as redirect start and end times, fetch start, DNS lookup start and end times, response start and end times, etc.. Additionally, the interface extends
PerformanceEntry with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
Note: This feature is available in Web Workers
This interface extends the following
PerformanceEntry properties for resource performance entry types by qualifying and constraining them as follows:
- Returns the resources URL.
- Returns the
timestampfor the time a resource fetch started. This value is equivalent to
- Returns a
timestampthat is the difference between the
The interface also supports the following properties which are listed in the order in which they are recorded for the fetching of a single resource. An alphabetical listing is shown in the navigation, at left.
stringrepresenting the type of resource that initiated the performance entry, as specified in
stringrepresenting the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
- Returns a
DOMHighResTimeStampimmediately before dispatching the
FetchEventif a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running. If the resource is not intercepted by a Service Worker the property will always return 0.
DOMHighResTimeStampthat represents the start time of the fetch which initiates the redirect.
DOMHighResTimeStampimmediately after receiving the last byte of the response of the last redirect.
DOMHighResTimeStampimmediately before the browser starts to fetch the resource.
DOMHighResTimeStampimmediately before the browser starts the domain name lookup for the resource.
DOMHighResTimeStamprepresenting the time immediately after the browser finishes the domain name lookup for the resource.
DOMHighResTimeStampimmediately before the browser starts to establish the connection to the server to retrieve the resource.
DOMHighResTimeStampimmediately after the browser finishes establishing the connection to the server to retrieve the resource.
DOMHighResTimeStampimmediately before the browser starts the handshake process to secure the current connection.
DOMHighResTimeStampimmediately before the browser starts requesting the resource from the server.
DOMHighResTimeStampimmediately after the browser receives the first byte of the response from the server.
DOMHighResTimeStampimmediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
numberrepresenting the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body.
numberrepresenting the size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings.
numberthat is the size (in octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings.
- An array of
PerformanceServerTimingentries containing server timing metrics.
See the example in Using the Resource Timing API.
|Resource Timing Level 2 (Resource Timing 2)|
BCD tables only load in the browser