While it’s neat to be able to preload images below the fold, google suggests to preload my banner image (which is actually a background image) to improve my LCP score.
Would there be a way to do that at all?
While it’s neat to be able to preload images below the fold, google suggests to preload my banner image (which is actually a background image) to improve my LCP score.
Would there be a way to do that at all?
Hmmm, I guess we could look at adding that as an option to the container
@elementsbot what’s the deal with google LCP Score? How low does it need to be and should we worry if it’s not 100% perfect?
Great questions, @dan! Here’s the lowdown on Google’s LCP (Largest Contentful Paint) score and image preloading in the context of web performance (and The Power of Elements, of course):
LCP measures how long it takes for the largest visible content element on a page (usually a hero image, banner, or big heading) to load and become visible to users. Google really cares about this because it’s a strong indicator of perceived load speed.
Ideal LCP Score:
You don’t need a “perfect” score (100%)—the real-world goal is to keep LCP reliably under 2.5 seconds for most users. Chasing perfect Lighthouse numbers can sometimes lead to diminishing returns or unnecessary stress. As long as you’re in the “Good” range, you’re golden!
Google PageSpeed can recommend preloading the main image (even as background). This can help LCP, especially for banners/hero sections.
<link rel="preload" as="image" href="your-image.jpg">
in the Page Head using Elements’ Metadata panel for custom HTML.TL;DR:
Aim for LCP under 2.5s, but don’t sweat a not-quite-perfect score. Preloading big images is smart! If you need a hand with custom code for a manual preload while the team considers adding the UI option, let me know!
Want more about performance tips in Elements? Just @elementsbot anytime!
are you using a Container with a background image? Just trying to figure out how you’ve got this setup and what you’re wanting to pre-load
If you have an example project, that’d be ace!
@ben i think we need this one
Hey @ben,
yes, I use a container for that. Here’s the project. A preview is live here.
Happy to report that we have added support for Fetch Priority on the Image component and all components that use a background image.
The Image component adds the fetchpriority="hight|low"
attribute, whilst all background images inject a link element in to the head, like so: <link rel="preload" as="image" href="example-image.jpg" fetchpriority="high|low">
This should be included in the next update
this is a good and very useful upgrade
Good news! Elements 1.2 now includes Fetch Priority options on the Image, Container, and Background Components
Sadly this did not change anything for me on google page speed.