I was sure to put 'fetchpriority="high"' as recommended, as well as preloading my CSS file as shown below:
<!-- Load the stylesheet that will reference the LCP image. -->
<link rel="stylesheet" href="{{ get_asset_url('/Heartland_November2018 Theme/Coded Files/Heartland_November2018-style.css') }}">
<!-- Preload the LCP image with a high fetchpriority so it starts loading with the stylesheet. -->
<link rel="preload" fetchpriority="high" as="image" href="{{content.featured_image}}" type="image/webp">
After doing the SEO scan, I still get the error that my picture is the LCP and I need to find a way to reduce the time for it to load.
How am I supposed to fix this? I've read the articles that Hubspot recommends me, as well as countless of other artciles and can't find a way to solve this. HELP PLEASE.
Hi there! In addition to the article Jennifer linked (which is a fantastic resource), this one was just posted a few days ago with some additional tips:
Check out the tips for `srcset` and `fetchpriority`. 🙂
Regardless of any optimizations, the largest image within the current viewport is the most likely candidate for LCP. The best we can do is make sure it's the right size and format for our users.
Okay thanks for linking the articles. I have referenced the web.dev article a handful of times, but I'll take a look into the other one that was linked. I work tomorrow, so I will update tomorrow with what I come across. Thanks again, I'll be in touch.
Following up: I just went ahead and tried it out. I referenced that article that was sent over, but I'm not sure if I have it written in correctly. Here it is
Furthermore, I have this in the <head> as mentioned on the article that was linked:
<!-- Load the stylesheet that will reference the LCP image. -->
<link rel="stylesheet" href="{{ get_asset_url('/Heartland_November2018 Theme/Coded Files/Heartland_November2018-style.css') }}" crossorigin>
<!-- Preload the LCP image with a high fetchpriority so it starts loading with the stylesheet. -->
<link rel="preload" fetchpriority="high" as="image" href="{{content.featured_image}}" type="image/webp" crossorigin>
With this, I got a warning in my console. I don't think it's set up correctly. It's saying I set up my preload attribute, but it's not being used.
So I converted my images into WebP, resized them to their appropriate dimensions so that they don't have to resize on page load, and compressed them as much as possible. I don't know what else to do besides that.
@jacjanowski I looked at PageSpeed Insights to see if there was any more detail.
I think the only other thing you could do to improve it would be to load it as a background image or move it out of the viewport so it's not at the top of the page...
If my reply answered your question please mark it as a solution to make it easier for others to find.