Sub topic 6
Reading the Network panel
This chapter assumes you know basic HTTP (methods, status codes, headers), how a browser loads a page, and how to open DevTools from the earlier chapters. Panel names follow Chromium browsers. Firefox and Safari have equivalent Network tools.
What the panel records
The Network panel logs every request the page makes while DevTools is open. That covers the HTML document, stylesheets, scripts, images, fonts, and fetch or XHR calls. Recording starts when the panel opens. To capture the initial page load, open DevTools first, then reload.
Each row is one request. The default columns are:
| Column | What it tells you |
|---|---|
| Name | The resource's file name or path |
| Status | The HTTP status code, or a failure label such as `(failed)` or `(canceled)` |
| Type | The resource kind, such as document, script, or fetch |
| Initiator | The file or line of code that triggered the request |
| Size | Bytes transferred over the network, or `(memory cache)` and `(disk cache)` |
| Time | Total time from start to the last byte |
| Waterfall | A timeline bar for each request |
Right-click the column header to add more columns, such as Protocol or Response Headers.
Filtering the noise
A busy page can make hundreds of requests. Use the filter bar to narrow them down.
- Click a type button (Fetch/XHR, JS, CSS, Img, Doc) to show only that kind of resource.
- Type text in the filter box to match URLs. You can also use property filters such as
status-code:404,larger-than:100k, ormethod:POST. - Tick Preserve log to keep rows across navigations. This helps when a redirect or form submission clears the page.
- Tick Disable cache (active while DevTools is open) to test a cold load.
Reading the waterfall
The waterfall shows when each request started and how its time was spent. Hover over a bar to see the phases.
| Phase | Meaning |
|---|---|
| Queueing | The request waited for the browser, for example because of the per-host connection limit |
| DNS Lookup, Initial connection, SSL | Setting up the connection to the server |
| Waiting for server response | Time to first byte (TTFB). The server is working, or the network is slow |
| Content Download | Receiving the response body |
Long bars point to different causes depending on the phase. A long "Waiting for server response" suggests slow server code. A long "Content Download" suggests a large payload or a slow connection. A long "Queueing" suggests too many requests competing at once.
A cached resource or one served over an existing connection skips some phases, so its bar is shorter.
Inspecting one request
Click a row to open its detail pane. These tabs matter most:
- Headers: the request URL, method, status, and both sets of headers. Check
Cache-Control,Content-Type,Content-Encoding, andAuthorizationhere. - Payload: the query string parameters or request body you sent.
- Preview and Response: the parsed and raw response body.
- Timing: the phase breakdown described above.
- Initiator: the call stack that caused the request.
Finding slow, failed and uncached resources
Work through the list with three questions.
Is anything failing? Filter on status-code:404 or sort by Status. A 4xx code means the client request was wrong or the resource is missing. A 5xx code means the server failed. A red row with no status often means a network error, a blocked request, or a CORS failure. Check the Console for the matching message.
Is anything slow? Sort by Time or Waterfall. Compare Size with the uncompressed size shown beneath it. If the two match for a text resource, check whether Content-Encoding is gzip or br. A missing encoding means the server isn't compressing it.
Is anything not cached? Reload the page normally and look at the Size column. Resources that return (memory cache) or (disk cache) were reused. Resources that transfer again each time may lack Cache-Control or ETag headers. A 304 status means the browser revalidated with the server and reused its stored copy, which still costs a round trip.
Common errors when reading the panel
- Testing with cache disabled and forgetting it. "Disable cache" makes every load look slower than real returning visits.
- Missing the first request. If DevTools was opened after the page loaded, reload to record it.
- Treating Time as server time. Time includes queueing and download. Read the Timing tab to see where it went.
- Ignoring the Initiator. An unexpected request is easiest to trace by its initiator.
You can also copy a request as a fetch or cURL command from the right-click menu. Run it in the Console to reproduce the call.
// Pasted from "Copy as fetch", then edited to test a different parameter
fetch("/api/users?page=2", {
method: "GET",
headers: { "Accept": "application/json" }
}).then(r => r.json()).then(console.log);Exercise
A page loads slowly. In the Network panel, one API request shows a very long "Waiting for server response" phase, while its "Content Download" phase is short. What does this suggest, and which panel feature would you check first?
Show answer
The server took a long time to produce the response, since time to first byte is high and the body downloaded quickly. Open the request's Timing tab to confirm the phase breakdown, then look at the server-side handling of that endpoint. A larger payload or compression is not the cause, because the download phase is short.
Exercise
A stylesheet shows 200 with a full transfer size on every reload, even though it never changes. Which response headers would you inspect, and what would you expect to find?
Show answer
Inspect the Headers tab for Cache-Control and ETag (or Last-Modified). You would expect them to be missing or set to no-store or max-age=0. Adding a suitable Cache-Control: max-age value lets the browser reuse the file from cache.