I am having an issue on my site where my above-the-fold masthead image comes in way too late which makes the site feel slow. The site is built with GatsbyJS where I am using the Gatsby Image plugin as well. I have tried with rel="preload as="image" but this didn't seem to do any difference:
<Img
fluid={
wpgraphql.imageFile.childImageSharp.fluid
}
id="hero__image"
style={{
position: "initial"
}}
rel="preload"
as="image"
/>
After reading the Gatbsy Image documentation I found that loading="eager"
could make a difference as well. I therefore have tried adding the loading="eager" but still my masthead image is one of the last things to be discovered in my waterfall.
How can I make my masthead image load critical and come in earlier in my waterfall?