These mechanisms solve four different problems
| Mechanism | Scope | What it does | Typical use |
|---|---|---|---|
preload | Current navigation | Fetches a specific resource early | Font, CSS background, late-discovered LCP |
prefetch | Future navigation | Fetches at low priority for cache | Chunk for the next page |
preconnect | Origin | Starts DNS/TCP/TLS early | Critical CDN or font provider |
fetchpriority | Specific request | Adjusts relative priority | LCP image, less important script |
A common mistake is treating preload, prefetch, preconnect and fetchpriority as different ways to do the same thing. The HTML Standard separates them clearly: preload is for a resource likely to be needed by the current navigation, while prefetch may be delayed because current-document resources take precedence. [1][3]
preconnect does not fetch a resource at all. It prepares the connection to an origin. fetchpriority is a hint about the relative priority of a specific fetch. [4][5]
Before adding any hint, ask which problem you are solving: late discovery of a file, connection setup latency, a likely future navigation, or an incorrect relative priority for an already-discovered resource?
preload: needed now, discovered too late
Preloading a stylesheet and font
<link rel="preload" href="/en/css/app.css" as="style">
<link
rel="preload"
href="/en/fonts/brand.woff2"
as="font"
type="font/woff2"
crossorigin
>
<link rel="stylesheet" href="/en/css/app.css">
The HTML Standard defines preload for a resource that is highly likely to be needed by the current navigation. The browser fetches it according to the destination in as and prioritization signals including fetchpriority. [1]
The best candidates are critical resources that would otherwise be discovered late: a font found after CSS parsing, a CSS background image or a resource initiated by JavaScript. [2]
Preload does not consume or execute the resource by itself. A preloaded script is still only fetched until the page later uses it through its normal mechanism. [2]
as and crossorigin: details determine request reuse
The as attribute is required for rel="preload" and defines the request destination. It helps the browser apply the correct security policy, Accept header and priority. [10]
Fonts and as="fetch" preloads require matching CORS behavior. Fonts are fetched using CORS even for same-origin URLs, so the preload must use a matching credentials mode. [2][10]
If the preload and the later resource use differ in URL, destination or CORS mode, the browser may be unable to reuse the earlier request and can fetch the file again.
prefetch: future navigation, not the current critical path
Prefetching a resource for a future page
<!-- Resource likely needed on a future same-site navigation -->
<link rel="prefetch" href="/assets/editor-chunk.js">
<!-- For future document navigations, prefer Speculation Rules
where supported. -->
rel="prefetch" hints that a resource may be needed by a future navigation. MDN describes it mainly for same-site navigation resources or subresources used by same-site pages. [3]
The browser can give such requests very low priority, delay them, or effectively skip them when the current page has more important work. The HTML Standard explicitly allows the user agent to delay prefetch in favor of resources needed by the current document. [1][3]
Do not use prefetch for a resource required for the current page's first render. Use preload or improve normal discovery instead.
For future documents, Speculation Rules are the more modern option
Document prefetch with Speculation Rules
<script type="speculationrules">
{
"prefetch": [
{
"source": "list",
"urls": ["/pricing", "/docs/getting-started"]
}
]
}
</script>
MDN recommends the Speculation Rules API as the preferred mechanism for future document prefetching where supported. Classic <link rel="prefetch"> remains useful for subresources but has limitations for document navigations. [6][7]
Speculation Rules can describe URL lists or patterns, while the browser may skip speculation due to user settings, Data Saver, Battery Saver or its own heuristics. [7]
Only safe GET navigations should be prefetched. Logout, add-to-cart, payment-start and other side-effect URLs must not be speculatively fetched. [7]
preconnect: optimize connection setup, not the file
Preconnect for a critical origin, dns-prefetch for a less important one
<!-- Critical third-party origin -->
<link rel="preconnect" href="https://cdn.example.com" crossorigin>
<!-- Lighter hint for a less critical origin -->
<link rel="dns-prefetch" href="https://analytics.example.com">
preconnect tells the browser that a connection to a given origin will probably be needed soon. For HTTPS this can include DNS resolution, TCP handshake and TLS handshake. [4]
It is most useful for critical cross-origin resources such as fonts, APIs or CDNs. MDN notes that same-origin requests typically gain nothing because the document's connection is already established. [4]
Do not preconnect to many domains. Every connection consumes sockets and memory and may never be used.
dns-prefetch: a lighter hint for less critical origins
dns-prefetch resolves DNS in advance but does not establish TCP or TLS, so its cost is lower than preconnect. [8]
MDN recommends preconnect for the few most important origins and dns-prefetch for other origins where saving only the DNS lookup may still help. [4][8]
For origins serving anonymous CORS resources such as fonts, crossorigin on preconnect can matter so the prepared connection matches the later request mode. [8]
fetchpriority: a heuristic adjustment, not a guarantee
High priority only for a truly important image
<img
src="/images/hero.avif"
width="1600"
height="900"
alt="Analytics dashboard"
loading="eager"
fetchpriority="high"
>
fetchpriority accepts high, low or auto and can be used on elements including <img>, <link> and <script>. MDN stresses that both the browser's base priority and the effect of the hint are implementation-dependent. [5]
The attribute does not make an undiscovered resource appear earlier. If an LCP image is hidden in CSS or created by JavaScript, fix discovery first or use preload.
Use high priority sparingly. If five images all have fetchpriority="high", the browser still needs to decide which request should actually win bandwidth.
preload plus fetchpriority: when combining them makes sense
Preload plus fetchpriority for a critical image
<link
rel="preload"
href="/images/hero.avif"
as="image"
fetchpriority="high"
>
<img
src="/images/hero.avif"
width="1600"
height="900"
alt="Analytics dashboard"
fetchpriority="high"
>
Preload and fetchpriority address different problems and can complement each other. Preload improves discovery, while fetchpriority helps adjust a request relative to competing resources. [1][5]
A typical example is an important LCP image that would otherwise be discovered late, such as a CSS background. Preload can start the request earlier and fetchpriority="high" can signal higher importance.
If the image already appears as a normal <img> high in initial HTML, preload may add little. In that case fetchpriority="high" alone can be enough if profiling shows a priority problem.
Responsive images: do not preload one file if the browser later chooses another
Responsive image preload with imagesrcset and imagesizes
<link
rel="preload"
as="image"
href="/images/hero-960.avif"
imagesrcset="
/images/hero-640.avif 640w,
/images/hero-960.avif 960w,
/images/hero-1600.avif 1600w
"
imagesizes="(max-width: 900px) 100vw, 60vw"
fetchpriority="high"
>
<img
src="/images/hero-960.avif"
srcset="
/images/hero-640.avif 640w,
/images/hero-960.avif 960w,
/images/hero-1600.avif 1600w
"
sizes="(max-width: 900px) 100vw, 60vw"
width="1600"
height="900"
alt="Product dashboard"
>
For srcset images, a preload can use imagesrcset and imagesizes. These attributes reproduce the candidate-selection logic of srcset and sizes on the eventual <img>. [11][12]
If preload hardcodes one image but the later <img> selects another candidate, the user may download both. A responsive preload should therefore reflect the actual layout. [11][13]
web.dev also notes that responsive preload depends on document viewport information, which limits how well it can be expressed in very early 103 Early Hints. [13][14]
Fonts and JavaScript modules need special treatment
modulepreload for a JavaScript module
<link rel="modulepreload" href="/en/js/dashboard.mjs">
<script type="module" src="/js/dashboard.mjs"></script>
Fonts are often discovered only after CSS, which makes them classic preload candidates. Use as="font", the correct type and matching crossorigin so the later request can reuse the resource. [2][10]
For JavaScript modules, rel="modulepreload" is the better mechanism because it can fetch, parse, compile and place the module into the module map. [9]
Do not preload an entire module graph without measurement. Fetching too many chunks early can delay CSS, fonts or an LCP image.
103 Early Hints: start before the final 200 response
Example 103 Early Hints response
HTTP/1.1 103 Early Hints
Link: </css/app.css>; rel=preload; as=style
Link: <https://cdn.example.com>; rel=preconnect
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
HTTP status 103 allows a server to send Link hints before the final 200 response. The browser may use those hints to begin preload or preconnect earlier. [14]
This is especially useful when server-side HTML generation takes measurable time but the server already knows which stylesheet or origin will be critical.
Not every hint fits Early Hints. Responsive image preload that depends on imagesrcset, imagesizes and viewport context has limitations at this very early stage. [13][14]
The most common mistake: too many hints
| Anti-pattern | Consequence | Better approach |
|---|---|---|
| Preload 15 JS files | Competes with LCP/CSS | Only truly critical modules |
| Preconnect every domain | Unused sockets and TLS work | A few critical origins |
fetchpriority=high everywhere | Signal loses meaning | Only key requests |
| Prefetch current LCP | Wrong priority and semantics | Preload or normal discovery |
Resource hints compete for the same network capacity. Preload is not free: fetching a noncritical file early can delay CSS, a font, an LCP image or interaction-critical JavaScript. [2]
The same applies to fetchpriority="high" and preconnect. Too many high priorities destroy the signal, while too many connections create unnecessary setup and resource use. [4][5]
The best configuration often contains very few manual hints because the browser already has a preload scanner and internal prioritization system.
How to verify the effect in DevTools
| Inspect | Question |
|---|---|
| Request start | Did the resource actually start earlier? |
| Priority | Did it change as intended? |
| Initiator | Was the request started by preload, parser, CSS or JS? |
| Transferred / cache | Was the preload reused later? |
| Connection timing | Did preconnect reduce DNS/TCP/TLS time? |
After adding a hint, inspect the Network waterfall. Check request start time, Initiator, Priority, cache reuse and whether the same URL was fetched again.
A preload that is not later consumed or causes an unused-preload warning should be removed or fixed. A preconnect is useful only if later requests actually benefit from shorter connection setup.
Test with throttling and a cold cache. On a fast local connection the cost of DNS, TCP and TLS may be almost invisible.
Decision matrix and production checklist
A simple rule works well: current page plus late discovery means preload, future navigation means prefetch or Speculation Rules, a new critical origin means preconnect, and a wrong relative priority for an already-discovered resource means fetchpriority.
Measure before adding a hint. Measure again afterward. If there is no improvement or competition gets worse, remove the hint.
- Use
preloadonly for resources required early by the current navigation. - Match
as,typeandcrossoriginso the preload can be reused. - Prefetch only resources with a high probability of use in a future navigation.
- Prefer Speculation Rules for future documents where supported.
- Limit
preconnectto a few critical origins. - Consider
dns-prefetchfor less important origins. - Use
fetchpriority="high"only on a small number of truly critical requests. - After each change, inspect the waterfall, cache reuse and Core Web Vitals.
