Watching requests in browser dev tools
35 min · Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)A product page feels slow, or a button does nothing, and nobody knows whether the page or the server is at fault. The browser records every request it makes, so you can look instead of guess.
Opening the Network tab: Preserve log and Disable cache
Dev tools are the inspection panels built into every browser. Their Network tab lists every request a page makes, with its full request and response.
The Network tab records requests only while it is open, so open it first and then load or reload the page. The steps are for Chrome and Edge; Firefox has the same tab with nearly the same names.
Open dev tools with F12 or Ctrl+Shift+I on Windows, or Cmd+Option+I on macOS (in Safari, first turn on Settings → Advanced → "Show features for web developers"). Reload with Ctrl+R or Cmd+R; add Shift to ignore the cache.
- Open dev tools with the shortcut for your computer (above), or right-click the page → Inspect.
- Click the Network tab at the top of the dev tools panel.
- Tick Preserve log: the list is no longer cleared when the page moves to a new address, for example after a login form sends you to another page.
- Tick Disable cache: while dev tools is open, the browser fetches every file again instead of reusing saved copies, so you see the real requests.
- Reload the page. Each row that appears is one request-response cycle.
One page load is many requests
The Network tab is the dev-tools panel that lists each request a page makes, with its name, status, type, size and time. It records only while it is open.
This example lists what loading one real page asks for.
Example 1 · What www.wikipedia.org loads
Name Status Type Sizewww.wikipedia.org 200 document 29.6 kBindex-43aa8c7b47.js 200 script 9.6 kBgt-ie9-507b16b6be.js 200 script 880 BWikipedia-logo-v2.png 200 png 16.1 kBsprite-e49fbf32.svg 200 svg+xml 18.6 kB5 requests for one page: 1 HTML document, 2 scripts, 2 images. An article page such as en.wikipedia.org/wiki/Mysore_Palace made 54 requests (after one link preview): 1 document, 2 stylesheets, 7 scripts, 42 files asked for by images and by the CSS, 1 beacon (a usage report) and 1 fetch.
What this code does
- Only the first row was typed into the address bar. The browser found the other four while reading the HTML and requested each one, each a separate request-response cycle.
- Size is the number of bytes that crossed the network. The HTML document is about 29.6 kB on the wire because the server compressed it; the page itself is larger.
- The article page shows how fast this grows: one visit, 54 requests, most of them images and icons. Watching this list is how developers find slow or failing files.
The first request fetches the HTML document. While reading it, the browser finds links to other files and requests each one: CSS files (styles), scripts (JavaScript, which runs in the page), images and fonts. Scripts may then make their own API calls for data. A simple page needs a handful of requests; a news or shopping page often needs over a hundred.
The list has columns for each request: Name (the end of the URL), Status (200 means it worked), Type, Initiator (what caused it), Size, Time and a Waterfall bar showing when it ran. The bar at the bottom adds up the number of requests, the bytes transferred and the load time.
(memory cache) or (disk cache) when the browser reused a saved copy and sent no request at all. That is why Disable cache matters when you want to see everything.Inspecting one request
The next example shows the same details a Headers tab gives, using curl.
Example 2 · The same parts a Headers tab shows, in curl
curl -sv https://example.com -o page.html* Trying [2606:4700:10::ac42:93f3]:443... ... > GET / HTTP/1.1 > Host: example.com > User-Agent: curl/8.21.0 > Accept: */* > ... < HTTP/1.1 200 OK < Date: Fri, 16 Oct 2026 02:23:00 GMT < Content-Type: text/html; charset=utf-8 < Connection: keep-alive < Server: cloudflare ...
What this code does
- Dev tools' General section is the
Tryingaddress (Remote Address), the method and path from> GET /(Request Method and URL) and200 OK(Status Code). - The
>lines are the Request Headers and the<lines are the Response Headers. A browser sends many more request headers than curl, such asAccept-Languageand cookies. - When the browser and curl disagree about a request, compare these two views line by line; the difference is usually a header.
Click any row to open its details. The tabs show everything that went across the network for that one request:
- Headers: under General, the Request URL, Request Method (such as
GET), Status Code and Remote Address (the server's IP and port); then the Response Headers and Request Headers. - Payload: the query string parameters, already decoded, and any data the request sent to the server (a form or JSON).
- Preview and Response: the response body, shown neatly (Preview) or as raw text (Response).
- Initiator: what started the request, such as the HTML or a script line.
The Timing view: where the time went
A waterfall is the bar in the Network tab that shows when each request started and how long each of its phases took.
This example measures the same phases with curl.
Example 3 · The Timing phases, measured with curl
curl -s -o page.html -w "dns lookup: %{time_namelookup}s\ntcp connect: %{time_connect}s\ntls done: %{time_appconnect}s\nfirst byte: %{time_starttransfer}s\ntotal: %{time_total}s\n" https://www.wikipedia.org/dns lookup: 0.053410s tcp connect: 0.099431s tls done: 0.434059s first byte: 0.488295s total: 0.615763s
What this code does
- Subtracting each line from the next gives the dev tools rows: DNS Lookup 53 ms, Initial connection 46 ms for TCP plus 335 ms for SSL, Waiting for server response 54 ms, Content Download 127 ms.
- Here TLS was the slowest part, which is typical for a first visit to a far-away server. A reused connection would skip DNS, TCP and TLS entirely, which is why the second request to a site is faster.
The Timing tab of a request splits its time into phases. They are the same steps you met in the earlier lessons, in the same order:
- Queueing and Stalled: waiting inside the browser, for example for a free connection.
- DNS Lookup, Initial connection (the TCP handshake, with the TLS part shown again as SSL): only for a new connection; a reused keep-alive connection skips them.
- Request sent and Waiting for server response: the server working on the request. A long wait here points at a slow server or database.
- Content Download: receiving the response. A long download points at a large file or a slow network.
Predict the output
Where did the time go?
Read the Timing phases and name the cause.
Round 1 of 2
The product page feels slow. What does this point at?
Fetch/XHR filter and Copy as cURL
Copy as cURL is a right-click option in the Network tab that puts a complete curl command for that exact request on your clipboard: URL, method, headers and data.
These two examples find the API call behind a preview card with the Fetch/XHR filter, then replay it in the terminal.
Example 4 · A fetch request found with the Fetch/XHR filter
Page: https://en.wikipedia.org/wiki/Mysore_PalaceAction: hover over the link "Krishnaraja Wodeyar IV" until a preview card appearsFilter: Fetch/XHRName Status Type SizeKrishnaraja_Wodeyar_IV 200 fetch 1.0 kBRequest URL: https://en.wikipedia.org/api/rest_v1/page/summary/Krishnaraja_Wodeyar_IV Request Method: GET Status Code: 200 Response: JSON with the title, a short description, an image and a one-line summary
What this code does
- Of the 54 requests on the page, the Fetch/XHR filter leaves just this one: a script on the page called Wikipedia's API when the mouse rested on a link, and used the JSON to draw the preview card.
- This is the same web page plus API pattern from the first lesson, now inside one page: HTML for you to read, JSON for the page's scripts.
Example 5 · Replay the request with Copy as cURL
# Copy as cURL (bash) gives a longer command with every header the browser sent.# The essential part:curl 'https://en.wikipedia.org/api/rest_v1/page/summary/Krishnaraja_Wodeyar_IV' \ -H 'accept: application/json'{"type":"standard","title":"Krishna Raja Wadiyar IV",...,"description":"Maharaja of Mysore from 1902 to 1940",...,"extract":"Krishnaraja Wadiyar IV (4 June 1884 – 3 August 1940) was the twenty-fourth Maharaja of Mysore, reigning from 1902 until his death in 1940.",...}What this code does
- The terminal now gets the same JSON the preview card was built from.
-Hadds a request header;\at the end of a line continues the command on the next line (bash and macOS). - From here you can change the URL to another page title, remove headers one by one to see which ones matter, or save the command in your notes as a test. In Windows PowerShell type
curl.exe, and use^instead of\(cmd) or put it all on one line.
The filter buttons above the list show only one kind of request: Doc, CSS, JS, Img, Font and others. Fetch/XHR shows the requests that scripts send to APIs, usually the most interesting ones for a developer, because they carry the app's data as JSON.
Paste the copied command in a terminal to send the same request again, change one thing at a time, or share the problem with a teammate. On Windows, choose Copy as cURL (bash) for Git Bash or Copy as cURL (cmd) for Command Prompt; the quoting differs.
Next step
Check your understanding
12 quick questions