日本語

Too Many Preloads Delay LCP in Core Web Vitals

​​Core Web Vitals​Chrome,HTML,Node.js,Playwright,web-vitals

I measured how the Core Web Vitals LCP (Largest Contentful Paint) changes when the hero image is preloaded with <link rel="preload"> and many other image preloads are placed in the same <head>. Through a relay that simulates a slow connection (150ms round trip, 1.6Mbps downstream), the median LCP was 1,132ms for a page that preloaded only the hero image, and 3,956ms for a page that also preloaded 10 other images.

This is the result of adding carousel or slider images beyond the first, and JavaScript files for later use, to preload "just in case", and then seeing LCP flagged as slow in PageSpeed Insights or Lighthouse. It shows where the extra time comes from. In this test, the hero image request was sent about 0.32 seconds after the page started loading in every case; the added time was spent transferring the image.

Note

The test environment was Ubuntu 24.04, Node.js 22.23.5, web-vitals 6.2.3, and Playwright 1.63.0. The browser was Chromium 158, the default launched by Playwright's chromium.launch(), and a new browser was started for each run. The server was an HTTP/1.1 server written with Node.js's http module. Instead of a real slow connection, I wrote a TCP relay that delays data and limits bandwidth and placed it inside the test environment. I did not test HTTP/2, HTTP/3, a CDN, resources on other domains, font preloads, browsers other than Chrome, Lighthouse, or real-user data (field data).

The test page and network conditions

The LCP element is a full-width hero image at the top of the body (hero.jpg, 1200×675, 129,547 bytes). Before the hero image preload in <head>, I listed preloads of images that the page does not use (p1.jpg, p2.jpg, and so on, each 800×450 and about 62KB). With 10 other images, the <head> looked like this (meta and title are omitted):

html
<link rel="preload" as="image" href="/p1.jpg">
<link rel="preload" as="image" href="/p2.jpg">
<!-- p3.jpg through p9.jpg follow the same pattern -->
<link rel="preload" as="image" href="/p10.jpg">
<link rel="preload" as="image" href="/hero.jpg">
<link rel="stylesheet" href="/style.css">

The body contains only a heading, the hero image as <img src="/hero.jpg" width="1200" height="675">, and a short paragraph. The server returns HTML with a different number and order of preloads depending on a URL query parameter.

The relay delays data by 75ms in each direction (150ms round trip) and adds one round trip of waiting when it accepts a new connection. Downstream traffic from the server to the browser is limited to 200,000 bytes per second (1.6Mbps) across all connections combined. It serves 16KB at a time, rotating through the connections that are waiting for data. When I fetched hero.jpg alone with curl through the relay, it took 0.95 seconds.

console
hero.jpg via 8081: connect=0.000134 ttfb=0.384518 total=0.947834 size=129547
hero.jpg direct 8080: total=0.000818 size=129547

I used this relay I wrote myself, not Chrome DevTools' network throttling, to slow the connection. In 55 measurements through the relay, hero.jpg was the LCP element every time.

I measured with Playwright, opening each page and recording LCP and its breakdown with the web-vitals library from Google (attribution build). The viewport was 800×600, and each condition was measured five times.

Adding preloads delayed LCP by nearly 3 seconds

These are the median LCP values. In every case, the other files' preloads come before the hero image preload.

Preloads in head Median LCP Range over 5 runs
None (only the hero image <img>) 1,280ms 1,276–1,284ms
Hero image only 1,132ms 1,124–1,132ms
3 other images + hero image 2,060ms 2,056–2,068ms
6 other images + hero image 2,984ms 2,984–2,988ms
10 other images + hero image 3,956ms 3,940–4,020ms
20 other images + hero image 4,104ms 4,028–4,112ms
4 JavaScript files + hero image 3,812ms 3,572–3,816ms
A horizontal bar chart comparing median LCP for each number of preloads. No preload is 1,280ms (gray), hero image only is 1,132ms, and adding 3, 6, 10, and 20 other images gives 2,060ms, 2,984ms, 3,956ms, and 4,104ms. With 4 JavaScript files it is 3,812ms. The longest, 4,104ms, is shown in pink. The chart labels are in Japanese.
Median LCP over 5 runs each. Up to 10 images, LCP grew sharply with each additional image preload; at 20 images it barely changed.

Preloading only the hero image made LCP 148ms shorter than the page with no preload. Adding 3 other images added 928ms, 6 added 1,852ms, and 10 added 2,824ms. The difference between 10 and 20 images was 148ms, much smaller than the increase from 6 to 10.

The extra time came from the transfer, not the request start

Looking at the LCP breakdown from web-vitals, the delay between TTFB and the start of the hero image load (resourceLoadDelay) was 6–18ms in every condition. The delay between the image arriving and it being rendered (elementRenderDelay) was 9–18ms. The extra time was in the image transfer (resourceLoadDuration). The table below shows the first run for each condition. For the 10-other-images page, the first run is the one with the longest LCP of the five (the transfer times in the other four runs were 3,606–3,626ms).

Preloads in head Image transfer time
Hero image only 798ms
3 other images + hero image 1,725ms
6 other images + hero image 2,648ms
10 other images + hero image 3,687ms
20 other images + hero image 3,707ms

For the page with 3 other images, I lined up the times each file was fetched using Resource Timing (in milliseconds since the page started loading):

console
-- img=3
  /style.css requestStart=  320 responseEnd=  638
  /p1.jpg    requestStart=  320 responseEnd= 1277
  /p2.jpg    requestStart=  320 responseEnd= 1584
  /hero.jpg  requestStart=  320 responseEnd= 2051
  /p3.jpg    requestStart=  321 responseEnd= 1732

All five requests were sent at about 320ms. The hero image request was not held back. Because the 1.6Mbps connection was shared with the other images, the hero image did not finish downloading until 2,051ms. The unused images arrived before the hero image.

The web.dev article on preloading critical assets also advises against preloading too much. Its explanation is that when many resources compete for bandwidth, the ones you meant to prioritize end up no faster than the rest, and the effect is larger for users on slower connections.

The small gap between 10 and 20 images came from the limit of six concurrent fetches

With 20 other images preloaded, the fetch times were as follows (p8.jpg and later are omitted):

console
-- img=20
  /p1.jpg    requestStart=  317 responseEnd= 1516
  /style.css requestStart=  326 responseEnd=  633
  /p2.jpg    requestStart=  326 responseEnd= 2149
  /p3.jpg    requestStart=  326 responseEnd= 2297
  /hero.jpg  requestStart=  326 responseEnd= 4094
  /p4.jpg    requestStart=  327 responseEnd= 2361
  /p5.jpg    requestStart=  634 responseEnd= 2506
  /p6.jpg    requestStart= 1516 responseEnd= 3385
  /p7.jpg    requestStart= 2150 responseEnd= 4019

The first six requests sent at the same time were the CSS, p1.jpg through p4.jpg, and the hero image. From p5.jpg onward, each request was sent only after one of the earlier fetches finished. As described in MDN's guide to connection management in HTTP/1.x, HTTP/1.1 browsers open about six connections per domain and send requests on them in parallel.

In <head>, I wrote the hero image preload last among the preloads (21st), but in this test the hero image was among the first six and was sent in that group. So the number of files competing with it for bandwidth stopped at about five, and the LCP gap between 10 and 20 images was small. However, all files finished downloading at about 4.2 seconds for the 10-image page and about 7.3 seconds for the 20-image page.

Changing the order or adding fetchpriority barely helped

I kept the 10 other-image preloads and changed how the hero image preload was written.

Preloads in head Hero image priority Median LCP
Hero image after the 10 other images Low 3,956ms
Hero image first, then the 10 other images Low 3,812ms
Hero image with fetchpriority="high", after the 10 other images High 3,956ms
Hero image with fetchpriority="high", after 20 other images High 4,044ms
Hero image with fetchpriority="high", after 4 JavaScript files High 3,784ms

The priority values come from the Chrome DevTools Protocol (CDP) Network.requestWillBeSent event, which records the initial priority (initialPriority) Chrome assigned to each request. Adding fetchpriority="high" raised the hero image's priority from Low to High. Even so, LCP stayed at 3,956ms on the page with 10 other images. Writing the hero image first reduced LCP by only 144ms.

In every variant, the delay between TTFB and the start of the hero image load (resourceLoadDelay) was 18ms or less, and the hero image was sent at the same time as the other files. The relay in this test sends the same amount to each connection that is waiting for data, in turn, so once a request is sent, the transfer speed does not change with the priority the browser assigned. The web.dev article on Fetch Priority also says that fetchpriority is a hint, not a directive. The same article notes that priorities take effect only over protocols that have a priority mechanism, such as HTTP/2 and HTTP/3.

On a page that preloaded 4 JavaScript files (about 150KB each) with as="script", Chrome gave those files High priority. Even after adding fetchpriority="high" to the hero image to make it High as well, LCP only changed from 3,812ms to 3,784ms.

Point

In this test, what shortened LCP was not raising the hero image's priority. It was removing the other preloads, so the hero image could use the connection without sharing it. Removing the 10 other-image preloads reduced the median LCP from 3,956ms to 1,132ms.

Unused preloads trigger a warning in the Console

Chrome's Console showed the following warning for each image or JavaScript preload the page did not use. It appeared once per unused file, so 10 times for the page with 10 other images.

console
The resource http://localhost:8081/p1.jpg was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

According to the web.dev article on preloading critical assets, this warning appears about 3 seconds after the load event. No warning appeared for the hero image preload in any condition.

However, on the page with 20 other images preloaded, not a single warning was recorded during the 3.5 seconds I waited after the load event. That page took about 7.3 seconds to finish downloading all its files. The DevTools Console is a useful clue for finding unused preloads, but the absence of a warning alone does not prove that you have not preloaded too much.

The FCP was also delayed when only the hero image was preloaded

When only the hero image was preloaded, LCP became 148ms shorter, but the median First Contentful Paint (FCP) rose from 496ms on the page with no preload to 664ms. In the first run, the CSS finished downloading at 637ms instead of 477ms.

On this page, the preload <link> comes before the <link rel="stylesheet"> for the CSS. In the first run, the hero image data started arriving at 707ms on the page without preload, after the CSS had finished downloading, and at 554ms on the page with preload, while the CSS was still downloading. So on the preloaded page, the hero image was sharing bandwidth with the CSS that the first paint depends on. When you add or remove preloads, check the FCP along with LCP to catch changes like this.


​Posted by 86