Performance and accessibility 4 min read Updated
Preload, preconnect and fetch priority
In short
Use preconnect for the few most critical third-party origins, preload only what a page needs very soon, and set fetchpriority on the main image.
A resource hint helps only when it is used on a few resources. Used everywhere, hints stop helping, so start with the one or two origins the first view truly needs. Preconnect opens the connection early, dns-prefetch resolves the name, preload fetches a file and fetchpriority ranks an image. Each does a different job, so pick the one that fits.
What each hint does
Two web.dev articles, on preconnect and dns-prefetch and on preloading critical assets, describe the first three hints. The MDN reference for the img element describes fetchpriority on images.
| Hint | What it does | Use it for | Watch out for |
|---|---|---|---|
| preconnect | Starts the DNS lookup, TCP connection and TLS handshake early | The most critical third-party origin | The browser closes it if it is unused for 10 seconds |
| dns-prefetch | Starts only the DNS lookup early | Other third-party origins | Saves only the DNS step |
| preload | Fetches a known resource early | A critical font, stylesheet or script needed very soon | Needs an as value; fonts need crossorigin; unused preloads trigger a warning |
| fetchpriority | Sets the relative priority of a fetch | The main image of the page, such as a hero image | A hint only; the default is auto |
Preconnect only the critical origins
Preconnect does the setup work for a cross-origin host early, so that a later request skips part of the handshake. The web.dev article describes it as the right tool for the most critical connections, such as a CDN that serves a script, an image or a font the page needs soon. It gives no benefit to same-origin requests, because that connection is already open.
The same article warns against connecting to many third-party domains. If a page needs many of them, preconnecting to all of them can be counterproductive. Keep preconnect for the few most critical origins, and use dns-prefetch for the rest.
dns-prefetch for the rest
For the remaining third-party domains that do not justify a full connection, dns-prefetch resolves the name ahead of time. That saves the first step of the connection. It is a lighter hint and suits secondary services that the page calls later. Before you add any third-party origin, read the article on the real cost of third-party scripts. The fewer origins a page depends on, the less these hints have to do.
Working on something similar in your own product? A few honest sentences are enough – we read every enquiry and reply by email. Apply with your idea
Preload what the page needs very soon
Preload tells the browser to fetch a resource earlier than it would otherwise find it, and the browser caches the result. A preload does not run a script or apply a stylesheet by itself. It only schedules the download with a higher priority. Every preload needs an as attribute, for example fetch, font, image, script, style or track. The as value sets the priority and lets the browser match the request correctly.
Two details are easy to get wrong. Fonts and fetch requests must carry the crossorigin attribute, and a font preloaded without it is fetched twice. A wrong or missing as value can also make a script download twice. Chrome reports unused preloads in the console, about three seconds after the load event, so every preload should be used. Fonts are a common case; see Web fonts without slowing the page or moving the text.
Set fetchpriority on the main image
MDN describes fetchpriority on the img element as a hint about the relative priority to use when fetching the image. It accepts high, low and auto, and auto, which sets no preference, is the default. Setting high on the main image asks the browser to fetch that image at a high priority relative to other images. It is still a hint, so the browser decides how much weight to give it. To find the element that determines Largest Contentful Paint, read the article on fixing Largest Contentful Paint.
A checklist before you add a hint
- List the third-party origins the page uses, and mark the one or two that the first view truly needs.
- Add preconnect only for those origins, and dns-prefetch for the others.
- Preload only a few resources that are needed very soon, and give each one an as value. Add crossorigin to fonts.
- Set fetchpriority to high on the main image only, and leave other images at the default.
- After loading, check the console for unused-preload warnings, and compare the timings with and without each hint.
This guide summarises two web.dev articles and two MDN references. The order of the checklist and the measurement step are general practice, not taken from those sources. Hints do not replace fixing slow responses or heavy scripts.
Common questions
- Does preconnect help with a file from the same origin?
- No. Preconnect benefits later requests to another origin. It has no benefit for same-origin requests, because that connection is already open.
- What happens to a preload that I do not use?
- Chrome shows a console warning about unused preloads, roughly three seconds after the load event. Preload only the most critical resources, because preloading too many can leave effectively none of them prioritised.
- Is fetchpriority a guarantee?
- No. MDN describes fetchpriority as a hint about relative priority, so the browser decides how much weight to give it. The default value is auto, which sets no preference.
Sources
- Preconnect and dns-prefetch, web.dev. Accessed 24 November 2026
- Preload critical assets, web.dev. Accessed 24 November 2026
- rel=“preload” HTML attribute value, MDN Web Docs. Accessed 24 November 2026
- HTML image embed element (img), MDN Web Docs. Accessed 24 November 2026
Further reading
-
Web fonts without slowing the page or moving the text
Ship one compressed, subsetted file per style you need, and pick a font-display value for each family on purpose.
-
Fixing Largest Contentful Paint one delay at a time
Split the LCP delay into four parts, then fix the largest one first instead of guessing at image tweaks.
-
The real cost of third-party scripts
A third-party script costs your visitors time even when it is small, so load it with care and remove what adds no clear value.
Have an idea that should exist? Or a working product that needs more customers, a new website or a complete rework? Bring us anything. Apply with your idea