The Network Panel
🌐 Lesson 4 — The Network Panel
The Network panel records every HTTP request the browser makes — HTML, CSS, scripts, images, fonts, API calls — and shows you headers, response bodies, and a timing breakdown for each one. Press Ctrl + Shift + E to open it, then reload the page to capture the full load sequence.
🗺️ The Network Panel Interface
| Status | Method | Domain | File | Type | Size | Time | Waterfall |
|---|---|---|---|---|---|---|---|
| 200 | GET | example.com | / | html | 12 KB | 143ms | |
| 200 | GET | example.com | /style.css | css | 8.2 KB | 88ms | |
| 304 | GET | example.com | /app.js | script | 0 B | 34ms | |
| 200 | POST | api.example.com | /api/users | json | 2.1 KB | 212ms | |
| 401 | GET | api.example.com | /api/profile | json | 320 B | 95ms | |
| 500 | POST | api.example.com | /api/orders | json | 512 B | 1.2s |
🚦 HTTP Status Codes
The Status column is colour-coded. These are the codes you'll see most often in DevTools:
Location response header.0 B transferred means the browser had a cached copy and the server confirmed it was still fresh. Don't mistake this for an error — it's actually optimal. Seeing 200 on every load for the same static file means caching is misconfigured.
📋 Inspecting a Request — Headers Tab
Click any request to open the detail panel. The Headers tab shows what the browser sent and what the server replied with.
The key things to check in the Headers tab when an API call fails:
| If you see… | It means… |
|---|---|
No Authorization in request | The client isn't sending credentials — auth middleware isn't running |
Authorization present but 401 | The token is expired, revoked, or signed with the wrong secret |
401 with no Access-Control-Allow-Origin | CORS is also failing — the browser may not even show you the 401 |
| 403 with valid token | User is authenticated but lacks the required role or permission |
Location: header on a 301/302 | The server redirected — check if it's redirecting to HTTP instead of HTTPS |
⏱️ The Timing Waterfall
Each bar in the Waterfall column is divided into colour-coded segments representing the phases of the HTTP lifecycle. Hover over any bar to see the exact milliseconds per phase.
TTFB (Time to First Byte) — the orange Waiting segment — is the server's processing time. A wide orange bar on /api/orders above tells you the server took 1.2 seconds to respond, not the network. Wide Receiving bars mean a large download; wide DNS/Connect bars mean connection setup isn't being reused.
📦 HAR Files — HTTP Archive
A HAR file (HTTP Archive) is a JSON snapshot of every network request in the Network panel — URLs, methods, headers, response bodies, cookies, and timing data — saved to a portable .har file you can share, replay, or analyse offline.
What a HAR File Looks Like
{
"log": {
"version": "1.2",
"creator": { "name": "Firefox", "version": "125.0" },
"pages": [{ "id": "page_1", "title": "https://example.com",
"pageTimings": { "onContentLoad": 231, "onLoad": 718 } }],
"entries": [
{
"startedDateTime": "2024-11-14T09:31:00.000Z",
"time": 143.2,
"request": {
"method": "GET", "url": "https://example.com/",
"headers": [{ "name": "Authorization", "value": "Bearer eyJ…" }]
},
"response": {
"status": 200, "statusText": "OK",
"bodySize": 12288
},
"timings": {
"dns": 8, "connect": 12, "ssl": 18,
"send": 1, "wait": 91, "receive": 13
}
}
// … one object per request
]
}
}
Creating a HAR File in Firefox
- Open the Network panel (Ctrl + Shift + E).
- Reproduce the activity you want to capture — reload the page, complete the user flow, or trigger the API call that's failing.
- Right-click anywhere in the request list → Save All as HAR, or click the 💾 floppy disk icon in the toolbar.
- Save the
.harfile to disk.
Reading and Importing a HAR File
You can replay a captured HAR file directly in Firefox's Network panel:
- Open the Network panel.
- Drag and drop the
.harfile onto the request list — or use the import icon in the toolbar if your Firefox version shows one. - All captured requests appear in the list exactly as recorded. Click any row and inspect headers, response bodies, and timings as normal.
You can also read a HAR file programmatically — it's plain JSON:
import json
with open('trace.har') as f:
har = json.load(f)
for entry in har['log']['entries']:
req = entry['request']
resp = entry['response']
ttfb = entry['timings']['wait']
print(f"{resp['status']} {req['method']} {req['url']} (TTFB: {ttfb}ms)")
What HAR Files Are Used For
HAR files capture everything: session cookies, Bearer tokens, API keys in headers, and potentially sensitive data in response bodies. Before sharing a HAR outside your organisation, open it in a text editor and search for
Authorization, Cookie, Set-Cookie, and token. Redact any values you find. Firefox does not automatically sanitise credentials on export.
💡 Practical Tips
Content-Encoding: gzip or br.
✏️ Exercises
-
Audit a page's requests. Open the Network panel on any site (
Ctrl + Shift + E), reload, and note the total request count and bytes. Filter by XHR/Fetch — how many API calls does the page make? -
Read an API response. Click a
fetchorxhrrequest → Response tab. Read the JSON the server returned. Then click Headers and find theContent-Typeresponse header. -
Investigate a 304. Find a request with status 304 (look in the JS or image rows). Click it → Headers tab. Find the
ETagorCache-Controlresponse header that tells the browser how long to cache this resource. - Read the timing breakdown. Click any external API request → Timings tab. Identify how long the Waiting (TTFB) phase was. Is most of the time spent waiting for the server or downloading the response?
- Throttle and compare. Set the throttle dropdown to Regular 3G and reload. Note the new total load time. Do loading states appear? Set it back to No throttling.
-
Create a HAR file. Open the Network panel, reload a page, right-click the request list → Save All as HAR. Open the file in a text editor. Find the first entry in
"entries"and read its"timings"object — what was the TTFB ("wait"value)? -
Import the HAR. Drag the
.harfile you just saved back onto the Network panel request list. Confirm all requests are replayed and you can click them to inspect headers and responses.
📌 Key Takeaways
- Open the panel before reloading — it only captures requests made while it's open.
- XHR/Fetch filter isolates API calls — the first filter to use when debugging backend communication.
- 304 = caching working correctly; 200 on every reload for a static file = broken cache headers.
- The Response tab shows the actual server error message on 4xx/5xx — the status code alone is not enough.
- The Waiting (orange) bar in the waterfall is TTFB — the server's processing time. A wide bar means a slow backend, not a slow network.
- HAR files are portable JSON snapshots of the entire network trace — share, replay, or analyse them offline.
- HAR files contain credentials — redact
AuthorizationandCookieheaders before sharing externally. - Network throttling (Regular 3G) reveals loading states and performance issues invisible on a fast dev machine.