Table of Contents
- 1 Setup
- 2 Environments:
- 3 Different loading Attribute:
- 4 Comparison with all the loading attributes:
- 5 Should I preload hero images? (Dilemma)
- 6 Ways to get the Screen resolution
- 7 What else can we do with these data?
- 8 Debug Largest Contentful Paint Elements with Web Vitals JS:
- 9 Plugins Recommendation:
- 10 Conclusion:
- 11 Recommendation
Whenever I run a Page Speed Insights (PSI) test on my post or page, PSI captures my hero image as the Largest Contentful paint (LCP) element. (See the screenshot below).
What is Largest Contentful paint (LCP)?
The Largest Contentful Paint (LCP) metric reports the render time of the largest image or text block visible within the viewport, relative to when the page first started loading.
Follow Web.dev article on Largest Contentful Paint in more details.

The question usually comes to our mind:
- Whether to preload hero image or feature image?
- Is it worth preloading or not?
Today in this blog post, I’m going to answer your question with real data or Field data using Google Analytics and web-vitals JS libraries and give you 3rd parties plugin recommendations.
From the field data, webpagetest result, and web-vitals JS data, you can decide whether it is the best decision to preload the hero image or not.
From my research, preloading critical resources like web fonts, and above-the-fold images improves LCP and you can see the result in the conclusion.
Setup
This is a test between-
In this example, I took the Creative Agency landing page template I created with Elementor with no Optimization other than Cloudflare (CDN) and Cloudinary for image optimization & Image CDN (Referral Link).
I use Fast 3G for my testing. After all, I usually test it in extreme cases because I can’t expect everyone will be using a 4G connection when they visit my website. See the screenshot below for the last 30 days.
Environments:
Things you need to considered before complaining are-
- There are lots of rendering Blocking resources
- Inconsistency in CDN cache hit ratio.
- Because the page is tested in fast 3G, it means there are 100 to 500ms latency it means larger the file sizes it will take more time to parse and download the resources.
Chrome Dev tools
With fast 3G connection without cache.

WebPageTest
With fast 3G connection without cache.

Different loading Attribute:
Loading=”lazy”:
By default, WordPress will lazyload above-the-fold images too by implementing the native lazy loading technique.

The featured image is loading at a 5.72sec mark in Chrome Dev tools Network panels.
Waterfall chart
You can see the waterfall chart, my featured image is loading at 36 marks in WebPageTest results and when the image is fully loaded LCP is also triggered. See the screenshot below


Loading=”eager”:
You can see the waterfall chart, my featured image is loading at 29 marks in WebPageTest results which is far better than the loading=”lazy” attribute counterpart and we can see images is loading much earlier even though there are lots of problems to be considered.

The featured image is loading at a 4.22sec mark in Chrome Dev tools Network panels.
Waterfall chart

The featured image is loading at 29 marks in WebPageTest results which is much better than the previous one but can be improved further with the help of rel=”preload”
Now we can see the inconsistency in LCP measurement because it can due to CDN cache hit ratio, 3rd parties domain response time ( cloudinary, unpack) and Cloudflare response time.
Loading=”eager” with rel=”preload”:
After implementing loading=”eager” attribute with rel=”preload”, the hero image/featured image is loading much quicker and is visible to the users and it improves LCP.

We can see a huge improvement from 5.72sec to 2.26sec.
Waterfall chart
After setting the loading=”eager” attribute and preloading, my featured image is loading at 8 marks in WebPageTest results which is far better than loading=”lazy” and “eager”


Comparison with all the loading attributes:
- First Screenshot: with loading=”lazy” attribute.
- Second screenshot: with Loading=”eager” attribute
- Third screenshot: With loading=”eager” + rel=”preload”
As you can see from the above comparison, there are benefits of preloading the hero image.
Here is the comparison in webpagetest, if you want to see it for yourselves. But the question is still there.
Should I preload hero images? (Dilemma)
Thank you to Phil Walton and Barry Pollard for their incredible tutorials on the web.dev in debugging web vitals in the field and the smashing magazine respectively, their tutorials help me debug the problems and give me insights on what to do.
To answer the question, Yes, it depends on your/mine visitor’s “Screen Resolution”.
Ways to get the Screen resolution
I assumed most webmasters/ website owners already implemented Google Analytics or any analytics on their websites and collected tons of user data.
Universal Analytics (UA) users:
If you’re a UA user, you need to click the ‘Audience tab’ this will open the drop-down menu and you need to click ‘Technology’ and choose ‘Browser OS’.
Follow the steps
- Audience
- Technology
- Select the date and choose Screen resolution:
Google Analytics 4 (GA4)
To get your visitor’s screen resolution, head over to the ‘User’ tab then click the ‘Tech’ and click the Overview to view what browsers, OS, Device category your visitors are using, etc.
Follow the steps
- Tech
- Overview
- Select the date and set it to last 28 days or 30 days or more, this way you will see more data
- Screen Resolution
Scroll down you will see ‘Screen resolution’ and click the ‘view screen resolution’ button.
I used GA 4 for 2 days and discontinued it because GA4 has fewer features (when I was using) compared to Universal analytics and if I use Google Tag Manager JS to deploy Google Analytics, it will add more weight to my website.
What else can we do with these data?
- You can simulate Screen resolution or screen size on your Dev tools or use LT Browser and see if your hero image is in the viewport or not.
- You can also simulate and test your site in Browserstack or Lambda (Affiliate Link), etc and do the same thing.
- Using Web-Vitals JS libraries and send the debug_target in Google Analytics Events data. And figure out whether it is a good idea to preload a hero image or not.
- You can use the webpagetest – Desktop Browser Dimensions feature (see the screenshot below) in Advanced testings.
One of the ways I used to identify or debug Largest Contentful Paint(LCP) is by implementing Web Vitals JS libraries and we can analyze the data with the help of Web Vitals Report.
—-
I will take remove unused CSS articles as an example to demonstrate because I barely don’t have enough field data to show you from the above example.
Debug Largest Contentful Paint Elements with Web Vitals JS:
I use Web-vitals JS libraries and send the debug_target/ debug identifiers events to Universal Analytics.
If you do inspect elements on my post and search it with the ‘selector’ below, it will refer to my hero image. ( Please watch the video, if you don’t know)
Due to continuous changes in design, if you use this selector right now. It might not be as accurate. You can see it for demonstration purposes only.
div.elementor-widget-container>div.post–wrapper>picture>div.image-zoom-wrapper>img.image-zoom
(Above debug identifiers (CSS selectors) is referring to my hero image and % of page visits on the elements is 31.67% (screenshot below) which is high, so it means loading=”eager” with rel preload might be a great idea to implement).
div.elementor-widget-container>div.post–wrapper>picture>div.image-zoom-wrapper>img.image-zoom
div.elementor-widget-container>figure.wp-block-image.size-full>img.wp-post-5328.wp-post-7533 wp-image-5347
Debug identifier is referring to me as an H1 tag.
div.elementor-widget-container>div.post–wrapper>h1.post–title
2nd CSS selectors are referring to my (H1) Heading tag because H1 to H6 are block-level elements.
Plugins Recommendation:
From my understanding, not all people are tech-savvy like me, and sometimes it is not possible to what I did on my landing page or blog post, so it means your best way is to implement with 3rd parties plugins that will identify critical resources (like CSS, fonts, etc) and preload your critical resources automatically:
- Swift Performance Pro (Affiliate Link): See Version 2.3 (beta) ([NEW] Preload Images) to learn more (if you have a screenshot referring to preloading, please send it to me) (Probably out of beta release)
- Unlimited Elements addons for Elementor: related forum post: Elementor’s forum.
- Elementor Pro – custom Code (affiliate link). (not the best method)
- Automatically Preload “Featured image“ with PHP: Only works with feature images (Attachment below), not with any images visible in the initial viewport or above the fold.
//Opening php and closing tag is missing because I'm using Code snippets plugin. If not make sure you include them.//
// It doesn't work with Cloudinary's Responsive images
add_action('wp_head', 'preload_featured_image', 0);
function preload_featured_image(){
if ( has_post_thumbnail() ){
$id = get_post_thumbnail_id();
$src = wp_get_attachment_image_src( $id, 'full' );
$srcset = wp_get_attachment_image_srcset( $id, 'full' );
$sizes = wp_get_attachment_image_sizes( $id, 'full' );
echo '';
}
}

Conclusion:
I have over 4K users that use 1920×1080 screen resolutions accordingly to Google Analytics that are a huge user base.
Please keep this mind that my Google Analytics Data might be inaccurate because of:
- Bots can inflate my data.
- Adblocker can block any tracking, Analytics JS, etc.
- Disabling JS entirely.
—-
So I decided to test my article removed unused CSS in the webpagetest with many different screen resolutions and turn out my feature image (screenshot or links below) triggers my Largest Contentful Paint elements.
Mine is not to preload it because I use Cloudinary Responsive image which automatically detects browser window size with JS and injects the image accordingly.
The choice is up to you to decide.
Recommendation
The best way to figure out the largest Contentful paint (LCP) elements is by monitoring and gathering real user data with the help of web-vitals JS libraries and deciding properly. Because Preloading and Pre-connect can become a double-edged sword if you didn’t do it properly.
You can see the full comparison in full detail I have tested on the webpagetest. I hope it helps you too
if you love this kind of post and gave you insights on whether to preload or not preload feature images.
Support
Don’t forget to support me by buying a cup of coffee or using any of my Affiliate links presented in the post. (This commission comes at no additional cost to you but it will keep the website a little help and write more comprehensive articles just for you)
- Thank you Gijo Varghese for reviewing my post and providing me FlyingPress image.
- Thank you Nicola Caldognetto for sharing the PHP code on the Facebook Group.
Thank you for reading till this end. Stay safe and don’t forget to post comments if you find this helpful 🙂