1. What is a HAR (HTTP Archive) File?
A HAR (HTTP Archive) file is a standardized JSON-formatted file used by all major web browsers to capture and track detailed performance metrics of every network request made during a page session. It includes DNS resolution time, SSL handshake duration, request/response headers, status codes, cookies, and transfer payloads.
2. Understanding the Request Lifecycle Breakdown
When you inspect a request in our HAR Viewer, the total duration is divided into distinct phases:
- Blocked / Queued: The time the request spent waiting in the browser queue (e.g., waiting for an available TCP socket or higher-priority assets).
- DNS Lookup: Time taken to resolve the domain name to an IP address. Can be optimized using
<link rel="dns-prefetch">. - Connect / SSL: Time spent completing the TCP three-way handshake and TLS/SSL certificate negotiation.
- Send: Time required to send HTTP request headers and body to the server.
- Wait (TTFB): Time spent waiting for the server to process the request and return the initial byte.
- Receive (Content Download): Time spent downloading the response body. High download time points to uncompressed images, large JavaScript bundles, or bandwidth bottlenecks.
3. Common Performance Bottlenecks Revealed by HAR Analysis
- Sequential Waterfall Chains: Look for cascading requests where request B doesn't start until request A finishes. This often happens with dynamic
@importin CSS or chained API calls. - Uncompressed Assets: Check the
Content-Encodingheader. If text resources (HTML, JS, CSS, JSON) lackgziporbr(Brotli) compression, payload sizes can be 70% larger than necessary. - Missing Cache-Control Headers: Static assets (logos, fonts, scripts) with
Cache-Control: no-cacheforce repeated downloads on every page reload. - Unoptimized HTTP Status Codes: Frequent 301/302 redirects add an extra full network roundtrip before the real resource can even begin loading.
4. Privacy Best Practice: Sanitizing HAR Logs
Because HAR files capture authentication cookies, Bearer tokens, and user credentials, using an in-browser, client-side HAR viewer like ToolBean ensures your proprietary logs remain on your device and are never sent to external servers.