PerformanceResourceTiming

The 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 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 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.

Properties

This interface extends the following PerformanceEntry properties for resource performance entry types by qualifying and constraining them as follows:

 PerformanceEntry.entryTypeRead only
Returns "resource".
PerformanceEntry.nameRead only
Returns the resources URL.
PerformanceEntry.startTimeRead only
Returns the timestamp for the time a resource fetch started. This value is equivalent to PerformanceEntry.fetchStart.
PerformanceEntry.durationRead only
Returns a timestamp that is the difference between the responseEnd and the startTime properties.

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.

PerformanceResourceTiming.initiatorTypeRead only
A string representing the type of resource that initiated the performance entry, as specified in PerformanceResourceTiming.initiatorType.
PerformanceResourceTiming.nextHopProtocolRead only
A string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
PerformanceResourceTiming.workerStartRead only
Returns a DOMHighResTimeStamp immediately before dispatching the FetchEvent if 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.
PerformanceResourceTiming.redirectStartRead only
A DOMHighResTimeStamp that represents the start time of the fetch which initiates the redirect.
PerformanceResourceTiming.redirectEndRead only
A DOMHighResTimeStamp immediately after receiving the last byte of the response of the last redirect.
PerformanceResourceTiming.fetchStartRead only
A DOMHighResTimeStamp immediately before the browser starts to fetch the resource.
PerformanceResourceTiming.domainLookupStartRead only
A DOMHighResTimeStamp immediately before the browser starts the domain name lookup for the resource.
PerformanceResourceTiming.domainLookupEndRead only
A DOMHighResTimeStamp representing the time immediately after the browser finishes the domain name lookup for the resource.
PerformanceResourceTiming.connectStartRead only
A DOMHighResTimeStamp immediately before the browser starts to establish the connection to the server to retrieve the resource.
PerformanceResourceTiming.connectEndRead only
A DOMHighResTimeStamp immediately after the browser finishes establishing the connection to the server to retrieve the resource.
PerformanceResourceTiming.secureConnectionStartRead only
A DOMHighResTimeStamp immediately before the browser starts the handshake process to secure the current connection.
PerformanceResourceTiming.requestStartRead only
A DOMHighResTimeStamp immediately before the browser starts requesting the resource from the server.
PerformanceResourceTiming.responseStartRead only
A DOMHighResTimeStamp immediately after the browser receives the first byte of the response from the server.
PerformanceResourceTiming.responseEndRead only
A DOMHighResTimeStamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
PerformanceResourceTiming.transferSizeRead only
A number representing the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body.
PerformanceResourceTiming.encodedBodySizeRead only
A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings.
PerformanceResourceTiming.decodedBodySizeRead only
A 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.serverTimingRead only
An array of PerformanceServerTiming entries containing server timing metrics.

Methods

PerformanceResourceTiming.toJSON()
Returns a DOMString that is the JSON representation of the PerformanceResourceTiming object.

Example

See the example in Using the Resource Timing API.

Specifications

Specification Status Comment
Resource Timing Level 1
The definition of 'PerformanceResourceTiming' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 43Edge Full support YesFirefox Full support 40IE Full support 10Opera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
connectEndChrome Full support 43Edge Full support 12Firefox Full support 40IE Full support 10Opera Full support 32Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 32Safari iOS Full support 11Samsung Internet Android Full support 4.0
connectStartChrome Full support 43Edge Full support 12Firefox Full support 40IE Full support 10Opera Full support 32Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 32Safari iOS Full support 11Samsung Internet Android Full support 4.0
decodedBodySizeChrome Full support 54Edge Full support 17Firefox No support NoIE No support NoOpera Full support 41Safari No support NoWebView Android Full support 54Chrome Android Full support 54Edge Mobile Full support 17Firefox Android No support NoOpera Android Full support 41Safari iOS No support NoSamsung Internet Android Full support 6.0
Basic supportChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
domainLookupStartChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
encodedBodySizeChrome Full support 54Edge Full support 17Firefox No support NoIE No support NoOpera Full support 41Safari No support NoWebView Android Full support 54Chrome Android Full support 54Edge Mobile Full support 17Firefox Android No support NoOpera Android Full support 41Safari iOS No support NoSamsung Internet Android Full support 6.0
fetchStartChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
initiatorTypeChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
nextHopProtocolChrome Full support 61Edge Full support 17Firefox Full support 51IE No support NoOpera No support NoSafari No support NoWebView Android Full support 61Chrome Android Full support 61Edge Mobile Full support 17Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
redirectEndChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
redirectStartChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
requestStartChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
responseEndChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
responseStartChrome Full support 43Edge Full support 12Firefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
secureConnectionStartChrome Full support 43Edge Full support YesFirefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
serverTimingChrome Full support 65Edge ? Firefox Full support 61IE No support NoOpera Full support 52Safari ? WebView Android Full support 65Chrome Android Full support 65Edge Mobile ? Firefox Android Full support 61Opera Android Full support 52Safari iOS ? Samsung Internet Android ?
transferSizeChrome Full support 54Edge Full support 17Firefox No support NoIE No support NoOpera Full support 41Safari No support NoWebView Android Full support 54Chrome Android Full support 54Edge Mobile Full support 17Firefox Android No support NoOpera Android Full support 41Safari iOS No support NoSamsung Internet Android Full support 6.0
workerStartChrome Full support 43Edge Full support 16Firefox Full support 58IE No support NoOpera Full support 32Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 58Opera Android Full support 32Safari iOS Full support 11Samsung Internet Android Full support 4.0
toJSONChrome Full support 43Edge Full support YesFirefox Full support 40IE No support NoOpera Full support 30Safari Full support 11WebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 42Opera Android Full support 30Safari iOS Full support 11Samsung Internet Android Full support 4.0
Available in workersChrome Full support 43Edge Full support YesFirefox Full support 60IE No support NoOpera Full support 32Safari No support NoWebView Android Full support 43Chrome Android Full support 43Edge Mobile Full support YesFirefox Android Full support 60Opera Android Full support 32Safari iOS No support NoSamsung Internet Android Full support 4.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Last updated by: fscholz,