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

Steps

  1. 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 -c
    
          4 <img
       20 <link
        4 <script

    That is 28 subresources declared in the HTML the server sent.

  2. 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;
    
    105

    104 subresources plus the document. The markup declared 28 of them.

  3. 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     1

    link means a <link> tag in the markup. css means a request a stylesheet started, a font or a background image. They are different rows for a reason.

  4. 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 4

    Four <img> elements, all lazy, against two requests with initiatorType of img. 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

Sign: The Network panel filter and the Resource Timing API give different counts for the same load.Cause: The panel filters by resource type, the API groups by what started the request. In this capture 21 requests came from link tags while 32 more were started by stylesheets and land in a separate css row. Neither number is wrong, and quoting one as the other starts an argument.
Sign: The markup count is used as the request count.Cause: The HTML of the page above declares 28 subresources and the browser made 104. Scripts, stylesheets and beacons add the rest after parsing. A curl grep is a floor, never a total.
Sign: The count changes between two runs with no code change.Cause: Lazy images enter only when they approach the viewport, and beacons depend on consent state and timing. Fix the viewport size, disable the cache, and do not scroll before reading the number.

What to check next

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.

basic6 minpublished updated Maks Verny