The PerformanceResourceTiming
interface enables retrieving and analyzing 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 XMLHttpRequest
, <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 performance entries
with other properties which provide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
This interface extends the following PerformanceEntry
properties by qualifying and constraining these properties for performance entries
with an entry type
of "resource
":
PerformanceEntry.entryType
- Set to "resource
".PerformanceEntry.name
- Set to the resource's URL.PerformanceEntry.startTime
- Set to the timestamp
immediately before the browser to fetch the resource
.PerformanceEntry.duration
- Set to the difference between the resource's responseEnd
timestamp
and its startTime
timestamp
.PerformanceResourceTiming.initiatorType
Read only
string
representing the type of resource that initiated the performance entry, as specified in PerformanceResourceTiming.initiatorType
.PerformanceResourceTiming.nextHopProtocol
Read only
string
representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).PerformanceResourceTiming.workerStart
Read only
worker
, returns the DOMHighResTimeStamp
immediately before the worker is started that fetches the resource; otherwise zero is returned.PerformanceResourceTiming.redirectStart
Read only
DOMHighResTimeStamp
that represents the start time of the fetch which initiates the redirect.PerformanceResourceTiming.redirectEnd
Read only
DOMHighResTimeStamp
immediately after receiving the last byte of the response of the last redirect.PerformanceResourceTiming.fetchStart
Read only
DOMHighResTimeStamp
immediately before the browser starts to fetch the resource.PerformanceResourceTiming.domainLookupStart
Read only
DOMHighResTimeStamp
immediately before the browser starts the domain name lookup for the resource.PerformanceResourceTiming.domainLookupEnd
Read only
DOMHighResTimeStamp
representing the time immediately after the browser finishes the domain name lookup for the resource.PerformanceResourceTiming.connectStart
Read only
DOMHighResTimeStamp
immediately before the browser starts to establish the connection to the server to retrieve the resource.PerformanceResourceTiming.connectEnd
Read only
DOMHighResTimeStamp
immediately after the browser finishes establishing the connection to the server to retrieve the resource.PerformanceResourceTiming.secureConnectionStart
Read only
DOMHighResTimeStamp
immediately before the browser starts the handshake process to secure the current connection.PerformanceResourceTiming.requestStart
Read only
DOMHighResTimeStamp
immediately before the browser starts requesting the resource from the server.PerformanceResourceTiming.responseStart
Read only
DOMHighResTimeStamp
immediately after the browser receives the first byte of the response from the server.PerformanceResourceTiming.responseEnd
Read only
DOMHighResTimeStamp
immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.PerformanceResourceTiming.transferSize
Read only
number
representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body.PerformanceResourceTiming.encodedBodySize
Read only
number
representing the size (in octets) received from the fetch (HTTP or cahce), of the payload body, before removing any applied content-codings.PerformanceResourceTiming.decodedBodySize
Read only
number
that is the size (in octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings.PerformanceResourceTiming.toJSON()
DOMString
that is the JSON representation of the PerformanceResourceTiming
object.See the example in Using the Resource Timing API.
Specification | Status | Comment |
---|---|---|
Resource Timing The definition of 'PerformanceResourceTiming' in that specification. | Editor's Draft | Initial definition. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support. | 43.0 | (Yes) | 40 | 10 | 32 | No support |
transferSize , encodedBodySize and decodedBodySize
| 54.0 | ? | ? | ? | 41 | ? |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|---|
Basic support. | 4.4 | (Yes) | (Yes) | 42 | ? | 10.0 | 32 | No support | (Yes) |
transferSize , encodedBodySize and decodedBodySize
| No support | 54.0 | ? | ? | ? | ? | 41 | ? | 54.0 |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming