日本語

Testing Slow Network Page Loads with Chrome DevTools Throttling

​​Chrome DevTools​Chrome,Web Performance

The Network panel in Chrome DevTools has a Throttling menu that deliberately slows down network traffic. If you pick "Slow 4G" or "3G" there and reload the page, you can see in what order images and CSS arrive, and how long each one is delayed, under a limited connection speed. This is useful for testing on slow connections like mobile data. In my test environment, a small page totaling 122 kB had a Load time of 28 ms with no throttling, which rose to 6.51 s on 3G. The numbers below are exactly as shown in the DevTools UI.

Note

The test environment was Ubuntu 24.04, Node.js 22, and Chrome for Testing 153.0.8010.12 (the version bundled with Playwright 1.63.0). Because the environment has no display, I ran Chrome in a normal window on a virtual display (Xvfb) and showed DevTools at the bottom of the screen. I performed the DevTools operations by sending mouse clicks and key presses from a script, and I reloaded the page by reopening the same URL from the script. The DevTools UI was in English. I served the test page from a small server I ran in the test environment (localhost:8080). I did not test custom profiles with my own speed settings, the Network conditions drawer, WebSocket traffic, CPU throttling, or page loads on a real phone or real mobile network.

Steps to throttle the network in the Network panel

  1. Open the page you want to test and select the Network panel in DevTools.
  2. Check "Disable cache" in the toolbar at the top.
  3. Open the menu to its right (it shows "No throttling" at first) and select one of "Fast 4G", "Slow 4G", or "3G".
  4. Reload the page.

"Disable cache" is a setting that loads the page without using the browser cache. The official documentation on disabling the cache describes it as a way to get close to what a first-time visitor experiences. My test server sends responses with Cache-Control: no-store, but I checked the box as described in the steps anyway.

In Chrome 153's DevTools, the menu was arranged as follows.

The Throttling menu open in the Network panel of DevTools. Under Disabled is No throttling. Under Presets are Fast 4G, Slow 4G, 3G, and Offline. Under Custom is Add… An orange triangle icon appears next to the Network tab name.
The Throttling menu open, with Fast 4G selected

There are four built-in presets: "Fast 4G", "Slow 4G", "3G", and "Offline". "Add…" is for adding a preset with speed settings you choose yourself. The official custom profile documentation explains how to create one by entering a name, download and upload speeds (in Kbps), and latency (in ms).

When you select any preset, an orange triangle icon appears next to the Network tab name. Its title attribute was "Network throttling is enabled". DevTools shows this icon so you notice that throttling is still active (official documentation). When I switched back to "No throttling", the icon disappeared.

Load times for each preset

The test page has HTML, CSS, and JavaScript files that are each under 1 kB, and it displays a single 640×400 JPEG image (121 kB).

html
<link rel="stylesheet" href="/style.css">
<h1>猫の手日記</h1>
<p id="status">読み込み中…</p>
<img src="/photo.jpg" alt="検証用の画像" width="640" height="400">
<script src="/app.js"></script>

I switched between presets, loaded the same page three times for each, and recorded the values in the last row of the Network panel. On the third 3G load, it showed the following.

text
4 requests | 122 kB transferred | 122 kB resources | Finish: 6.51 s | DOMContentLoaded: 4.11 s | Load: 6.51 s

According to MDN, DOMContentLoaded fires when the HTML has finished parsing, and it does not wait for images to load. However, when there is a <script> without defer or async, as in this page, it does not fire until that script has finished executing. Load fires once all of the page's files, including images and CSS, have arrived. I summarized the median of the three runs in the table below.

Preset DOMContentLoaded Load
No throttling 28 ms 28 ms
Fast 4G 348 ms 467 ms
Slow 4G 1.17 s 1.83 s
3G 4.09 s 6.51 s
A horizontal bar chart of Load times. No throttling is 28 ms, Fast 4G is 467 ms, Slow 4G is 1.83 s, and 3G is 6.51 s.
Load time for each preset (median of three runs)

With throttling on, the Load time varied very little between runs. Even on 3G, which had the largest spread across the three runs, the difference was only 30 ms, and each run took about the same time. Without throttling, the values ranged from 19 to 33 ms, so the relative variation was much larger.

Throttling also clearly slowed down the page on my local development server (localhost).

Speeds for each preset and where the delay comes from

I read the preset values built into DevTools. They are as follows. In the DevTools source code, speeds are written in bytes per second (bits per second divided by 8). In the table below, I also converted them back to bits per second by multiplying by 8.

Preset Download Upload Latency
Fast 4G 1,012,500 B/s (8.1 Mbps) 168,750 B/s (1.35 Mbps) 165 ms
Slow 4G 180,000 B/s (1.44 Mbps) 84,375 B/s (675 kbps) 562.5 ms
3G 50,000 B/s (400 kbps) 50,000 B/s (400 kbps) 2,000 ms

The Network panel after loading the page on 3G looked like this.

The Network panel after loading the page on 3G. localhost took 2.01 s, style.css 2.03 s, photo.jpg 4.49 s, and app.js 2.09 s. The bottom row shows Finish 6.51 s, DOMContentLoaded 4.11 s, and Load 6.51 s.
The Network panel after loading on 3G (some blank rows in the middle omitted)

Even the small files took about 2 seconds each to arrive. The 0.6 kB HTML file (shown as localhost in the Name column) took 2.01 s, and the 0.3 kB CSS and JavaScript files took 2.03 s and 2.09 s. These times are almost the same as the 3G latency of 2,000 ms, so each file was delayed by roughly the latency.

The 121 kB image took 4.49 s. Sending 121 kB at 50,000 B/s takes about 2.4 s, and adding the 2 s latency gives 4.4 s, which is close to the value shown. On Slow 4G the image took 1.25 s. Using the same calculation, 0.67 s of transfer time plus 0.56 s of latency gives 1.23 s.

The timeline in the Overview bar at the top shows that the HTML arrives first, followed by the CSS, JavaScript, and image all loading at the same time. Adding the HTML's 2.01 s to the JavaScript's 2.09 s gives about 4.1 s, which is close to the DOMContentLoaded value of 4.11 s. Adding the HTML's 2.01 s to the image's 4.49 s gives about 6.5 s, which is close to the Load value of 6.51 s. The size of the single image directly pushed up the Load time.

What appears when Offline is selected

When I selected "Offline" from the menu and reloaded, the page did not open. In the Network panel, the HTML request showed (failed) as follows. This row is written out with the Name, Status, Type, Initiator, Size, and Time columns separated by "|".

text
localhost | (failed)net::ERR_INTERNET_DISCONNECTED | document | Other | 0.0 kB | 1 ms

The official Offline documentation describes this setting as a way to quickly test a no-network state when building an app that works offline with a Service Worker.

​Posted by 86