Overview
The Resource Timing API allows developers to programmatically access precise timing information for images, scripts, stylesheets, and other assets. This data is essential for identifying bottlenecks in the loading process.
Key Metrics Provided
- DNS Lookup Time: Time spent resolving the domain name.
- TCP Connection Time: Time spent establishing a connection.
- TLS Handshake Time: Time spent on secure connection setup.
- Request/Response Time: Time spent sending the request and receiving the first/last byte.
Usage
Data is accessed via performance.getEntriesByType('resource'). This allows for real-user monitoring (RUM) and automated performance regression testing.