Resource hints for LCP: preload, preconnect, fetchpriority
Browsers guess which files matter most, and they guess wrong on hero images. Here is how preload, preconnect, and fetchpriority speed up LCP, and when they backfire.
Most slow Largest Contentful Paint scores are not caused by a heavy image. They come from the browser finding the image late. Resource hints let you tell the browser what matters before it works that out on its own. Used well, they trim real time from LCP. Used everywhere, they make pages slower.
Why LCP often starts late
LCP has four parts: time to first byte, the delay before the browser starts loading the LCP resource, the load time of that resource, and the delay before it renders. Most teams fix the third part by compressing the file. The second part is often the bigger problem.
The browser reads your HTML top to bottom. It only requests an image once it sees the tag. If the hero image is set in a CSS file, or added by JavaScript, the browser finds it later still. Every step of waiting is time the user stares at a blank space.
Before adding any hint, check what your LCP element actually is. Open PageSpeed Insights or the Performance panel in Chrome DevTools and look at the LCP breakdown. If the resource load delay is small, hints will not help you.
Start with fetchpriority
The fetchpriority attribute is the lightest fix. You add it to an img tag with the value high. It tells the browser to rank that image above other images when it schedules downloads. It does not change when the browser discovers the image. It changes how quickly the request gets bandwidth once found.
- Use fetchpriority high on the one image most likely to be your LCP element.
- Do not add it to every image. If everything is high priority, nothing is.
- Never lazy load the LCP image. Lazy loading and high priority work against each other.
- You can set fetchpriority low on below-the-fold images, but test the result before you keep it.
Support for fetchpriority is broad in current Chromium browsers and has grown in others. Browsers that do not understand it simply ignore it, so it is safe to add.
Use preload when the browser finds the file too late
A preload link in the head tells the browser to fetch a file now, before the parser reaches the tag that uses it. It is the right tool when the LCP image comes from a CSS background, a font, or a script. If the image is a plain img tag near the top of the HTML, preload usually adds nothing.
Preload mistakes that cost you
- Preloading a file the page never uses. The browser downloads it anyway and may warn in the console.
- Preloading a different image size than the one the page picks. If you use responsive images, the preload needs matching srcset and sizes values, or the browser fetches two files.
- Preloading too many files. Each one competes with the others for bandwidth.
- Forgetting the crossorigin attribute on fonts. Without it the font downloads twice.
A good rule is to preload one or two files at most: the LCP image if it is hidden from the parser, and the primary web font if text is your LCP element.
Use preconnect for third-party origins
Before the browser can fetch a file from another domain, it has to look up the address, open a connection, and finish the security handshake. A preconnect link starts that work early. It helps when your LCP image or font lives on a CDN or another host.
Keep the list short. Open connections cost memory and, if unused, the browser closes them after a short time. Two or three origins is plenty. For origins you might need later, dns-prefetch is a cheaper option that only does the address lookup.
If your images are on the same domain as your HTML, preconnect does nothing for them. The connection is already open.
Early Hints and the limits of all this
HTTP 103 Early Hints let a server send preload and preconnect instructions before the full page is ready. This helps most when your server is slow to build the HTML, since the browser can start fetching files during that wait. Support depends on your host or CDN and on the browser, and some setups handle it poorly, so measure before you rely on it. Treat it as an advanced step, not a starting point.
Resource hints are also not a fix for a slow server. If time to first byte is the largest piece of your LCP, work on that first. Our guide to server response time covers it. Hints shave the gap between discovery and download. They cannot make a late response arrive sooner.
Google measures Core Web Vitals from real Chrome users, so a change only counts once field data catches up. Lab tests will show the effect right away, but Search Console can take weeks to reflect it. Check both before you decide a change worked.
What to do today
- Find your LCP element on your top five templates using PageSpeed Insights.
- Check the load delay in the breakdown. If it is large, continue. If not, look elsewhere.
- Add fetchpriority high to the LCP image and remove any lazy loading from it.
- If the image is set in CSS or JavaScript, add a single preload link, or better, move it into an img tag.
- Add preconnect for the one third-party origin that serves your LCP file, if there is one.
- Re-test in the lab, then watch field data for a few weeks.