Lighthouse: Preload Largest Contentful Paint image

Recommendations

Lighthouse
Metrics
Audits
PageSpeed (Legacy)
YSlow (Legacy)

Overview

Preloading the Largest Contentful Paint (LCP) image can display your hero image or website banner much earlier in the page load.

A fast LCP enables your page visitors to consume substantial content sooner, enhancing their user experience.

As LCP is one of the Web Vitals, there are SEO benefits associated with improving your LCP timings by preloading related assets as well.

How does your site score on this audit?

How does preloading Largest Contentful Paint image affect page performance?

Preloading the LCP image can help your page appear visually complete earlier in the page load, signaling to your visitors that your page content is loading faster.

The LCP element, as the name indicates, is the largest content resource painted by the browser; often this content contains an image (slider, background or hero image, etc.).

Often, the LCP element resource is far down the request chain and a hero element is usually required for onload (e.g., when it is a part of a theme/slider/carousel).

Since you already know what your LCP image is, use <link rel="preload"> to let the browser know in advance that it needs to load it.

Fast vs slow LCP
Preloading your LCP image can improve your LCP time and give the impression that your page loaded faster.
The green website looks more visually complete at 0.2s than the red website.

By preloading the image, you cut out the late resource fetch time and the LCP image is immediately inserted into the DOM once it is referenced. This can help your page achieve a faster LCP timing and improve your page experience.

How does GTmetrix trigger this audit?

GTmetrix triggers this audit only if all of the below conditions are true:

  • The LCP image wasn't loaded via <link rel="preload">
  • The LCP image was loaded over the network
  • The LCP image wasn't discovered from the main document (e.g., LCP image being delayed in the critical request chain)
  • The LCP image was loaded from the main frame (i.e., not loaded from an <iframe>)
Preload LCP Audit
GTmetrix checks if the LCP image can be preloaded to save time.

If the asset can be preloaded to save time, GTmetrix displays the LCP image and its associated time savings (in ms). Note that this audit has a low impact on your Structure Score.

Note: GTmetrix may still list the LCP image if the time savings are estimated to be zero. This means that the asset can be preloaded due to being requested late in the page load, but depending on when it is inserted into the DOM, there may not be any significant time savings.

How to preload Largest Contentful Paint image?

If GTmetrix flags the LCP image, you can preload it by using a link tag in your HTML header just as you can preload any other key asset.

Add the following code to the <head> of your HTML:

<link rel="preload" href="/path/to/image.jpg" as="image">

You can also use <link rel="preload"> with responsive images for faster image loading, as follows:

<link rel="preload" as="image" href="/path/to/image.jpg"
  imagesrcset="image_400px.jpg 400w, image_800px.jpg 800w, image_1600px.jpg 1600w"
  imagesizes="50vw"/>

For WordPress Users

If you're using WordPress, you can take advantage of a plugin like WP Rocket to preload the Largest Contentful Paint (LCP) image. WP Rocket is a performance plugin that automatically applies 80% of web performance best practices, making your website load faster immediately.

As for addressing this important optimization, WP Rocket offers the automatic Critical Image Optimization feature, which is enabled by default upon activation. This option automatically detects the Largest Contentful Paint (LCP) image, which will be preloaded, the fetchpriority="high" attribute will be set, and the image will be excluded from the LazyLoad too.

To further boost LCP performance, WP Rocket offers additional powerful one-click features like JS and CSS optimization to eliminate render-blocking resources, and font preloading. These can be easily activated in WP Rocket's user-friendly settings panel.

Read our detailed WordPress optimization guide using WP Rocket.

Summary

6.5.0
 ***

Using WordPress?

GTmetrix recommends WP Rocket to improve this audit and speed up your site instantly.

Boost your performance now! WP Rocket applies 80% of web performance best practices automatically.

Get WP Rocket Now

Cookie Policy

By clicking "Allow All" you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View cookie details

Deny Allow All
×