How to check number of requests on a page
Open DevTools, Network tab, tick "Disable cache", reload, and read the request count in the status bar. For the same number in the Console, run performance.getEntriesByType('resource').length + 1. On an MDN article that returned 105: one document and 104 subresources.
Why check this
Request count is the cheapest signal that a build changed shape. A tag manager added, a font family split into four files, an icon sprite replaced by forty separate images: each one raises the count and none of them shows up in a diff of the rendered page. Run this on staging before sign-off, and keep the number in the release notes.
The failure it catches is connection pressure. A page pulling 104 subresources from several hosts spends time on lookups and handshakes that no single response reveals.
Prerequisites
- Chrome or another Chromium browser with DevTools. The Network panel reference names each column.
- curl 7.52 or later, plus
grep, for the count the markup declares. - The cache disabled for the browser measurement, or requests served from memory are missing from the count.
- The browser figures on this page come from one capture on one machine on 2026-09-11, reformatted for reading. Your own load will differ.
Steps
- Step 1.
Count what the markup asks for, before any script runs.
curl -s --compressed https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS -o page.html && grep -o -E '<(script|link|img|iframe|source)[^>]+(src|href)="[^"]+"' page.html | grep -o -E '^<[a-z]+' | sort | uniq -c4 <img 20 <link 4 <scriptThat is 28 subresources declared in the HTML the server sent.
- Step 2.
Count what the browser actually fetched. Open the same URL, DevTools, Console tab, and run this after the load finishes.
performance.getEntriesByType('resource').length + 1;105104 subresources plus the document. The markup declared 28 of them.
- Step 3.
Break the count down by what started each request.
performance.getEntriesByType('resource').reduce( (acc, e) => ((acc[e.initiatorType] = (acc[e.initiatorType] || 0) + 1), acc), {});script 40 css 32 link 21 beacon 5 fetch 3 img 2 other 1linkmeans a<link>tag in the markup.cssmeans a request a stylesheet started, a font or a background image. They are different rows for a reason. - Step 4.
Cross-check the image rows against the elements on the page.
console.log('img elements', document.images.length, 'lazy', [...document.images].filter((i) => i.loading === 'lazy').length);img elements 4 lazy 4Four
<img>elements, all lazy, against two requests withinitiatorTypeofimg. Lazy images below the fold never became requests.
How to read the result
| What you see | What it means | What to do |
| --- | --- | --- |
| API count above the markup count | Scripts add requests at runtime | Read the script and fetch rows and name the owner of each. |
| A large css row | Stylesheets pull fonts and background images | Those are not visible in the HTML. Audit the stylesheet, not the page. |
| beacon requests present | Analytics is firing during the load | Confirm they are not blocking. Five of them appeared in the capture above. |
| The count drops on a second reload | The cache is serving responses | Tick "Disable cache" and reload, or the count is a cache report. |
Common mistakes
What to check next
- How to check page size: the bytes behind the count, and the cache trap that ruins both numbers.
- How to check if keep-alive is enabled: whether those requests share one connection or open a new one each time.
- How to check render blocking resources: which of the counted requests delay the first paint.
- How to check if images are lazy loaded: explains the gap between image elements and image requests.
FAQ
How do I count requests without DevTools?
Fetch the HTML with curl and grep the tags, as in step 1. That gives the requests the markup declares. Anything a script adds at runtime is invisible to this method.
Should the document be counted?
Say which you are counting. performance.getEntriesByType('resource') excludes the document, so add one for a total. The DevTools status bar includes it.
Is a high request count a defect?
Not on its own. Over HTTP/2 many small responses share one connection. The count matters when the requests hit several hosts or block rendering.
Why is the number lower on a repeat visit?
Cached responses are still requests, but some are served from memory and never reach the network panel unless the cache is disabled. Compare cold loads only.
Verified
Verified by Maks Vernycurl 8.21.0Chrome DevTools capture of 2026-09-11
Each output block is what the command above it printed on that date, on the host named in the step. Figures read from a live site move between runs. Compare the shape of the answer rather than the digits, and see the methodology for how a page is re-verified.
Related on this site
basic6 minpublished updated Maks Verny