← Back to blog

Preload vs Prefetch: What Each Does and When to Use It

December 4, 2026
Preload vs Prefetch: What Each Does and When to Use It

Preload is for the page you're on: it tells the browser to fetch a file early because the page will need it within a couple of seconds. Prefetch is for the next page: it tells the browser to fetch a file at low priority, when the network is idle, because the visitor might need it on a later navigation. Mix them up and you get slower pages, duplicate downloads and wasted bandwidth. Get them right and the first paint, or the next click, gets noticeably faster.

This article covers both, plus the pair that confuses people next to them, dns-prefetch and preconnect. When you've added hints, you'll want to confirm what your server actually sends back. Pingfloat's free tools include HTTP response header inspection, so you can check that a Link header or a cache policy is really on the response and not only in your template.

Pingfloat
Check What Your Server Sends
After adding resource hints, inspect your HTTP response headers to confirm the server sends the Link header and cache policy you expect.
Visit

TL;DR

  • Use rel="preload" for a late-discovered resource the current page needs soon, such as a font or an LCP background image. It's a high-priority request.
  • Use rel="prefetch" for something a likely next page will need. It's low priority, optional, and the browser may skip it.
  • Use preconnect for a few critical third-party origins and dns-prefetch for the rest. Neither does anything for your own origin.
  • Every preload needs a correct as attribute, and font preloads need crossorigin, or the file downloads twice.
  • Measure one hint at a time. More hints don't mean a faster page.

Table of Contents

Preload and prefetch: the difference in one request

Both hints are <link> tags that ask the browser to download something before it would normally ask for it. What differs is the question each one answers. Preload answers "what does this page need right now that the browser will find too late?". Prefetch answers "what will the visitor probably need next?".

That difference sets the priority. Preload starts an early, high-priority request for a resource the current page requires, while prefetch makes a low-priority speculative request for something future navigations are likely to use, and it may go unused if the visitor doesn't navigate that way. MDN adds that browsers give prefetched resources lower priority than preloaded ones, because the current page matters more than the next one.

The caching differs too. According to MDN, prefetch results are kept in the HTTP cache on disk, while preload results sit in a per-document in-memory cache. That's why preloading something the current page never uses is a pure waste, while a prefetched file can still help a later page.

PreloadPrefetch
Question it answersWhat does this page need soon?What will the next page likely need?
PriorityHighLow, when idle
Mandatory for the browser?Yes, in browsers that support itNo, it can be skipped on slow connections
Typical targetFonts, LCP images, CSS-referenced assetsNext-page scripts, styles, documents
Example<link rel="preload" href="/fonts/body.woff2" as="font" type="font/woff2" crossorigin><link rel="prefetch" href="/js/checkout.js" as="script">

The optional nature of prefetch is easy to forget. Ivan Akulov's rule of thumb is that preload is for resources you'll need in a few seconds, while prefetch is for a subsequent page and browsers may skip it. Treat prefetch as a bonus, never as something your page depends on.

When preload earns its place

The browser already discovers most resources while parsing your HTML: a stylesheet link in the head, a script tag, an image in the markup. Preloading those gains you nothing. The hint pays off for resources the browser finds late.

web.dev limits preload to late-discovered critical resources: most commonly font files, CSS pulled in with @import, and CSS background images that turn out to be the Largest Contentful Paint (LCP) element. LCP is the Core Web Vitals metric for how long the biggest visible element takes to render. A font is a good example. The browser can't know it needs body.woff2 until it has downloaded the CSS and worked out which text uses it, so the font request starts late and text renders late. A preload in the head starts that request in parallel with the CSS.

The syntax has traps. MDN lists the valid as values (fetch, font, image, script, style, track) and notes that font and fetch preloads need the crossorigin attribute. The as value lets the browser set the right priority, the right Content Security Policy checks and the right Accept header. Leave it out and, according to web.dev, the resource is downloaded twice. Fonts are always fetched in CORS mode, so a font preload without crossorigin also downloads twice: once for the hint, once for the real request, and the first is thrown away.

Also note that despite the name, preload doesn't run a script. It only schedules the download and caches it at higher priority. You still need the normal <script> tag.

When preload earns its place

How many preloads is too many

Preload's high priority is the risk. If everything is high priority, nothing is. Chrome's guidance is to use fetchpriority="high" on no more than one or two critical image preloads, and to limit preloads to two images and two or three essential fonts.

The field data backs that up. The HTTP Archive's Web Almanac found that 21.5% of preload hints went unused within three seconds, and that a higher number of preload hints correlated with slower load times. Chrome prints a console warning when a preloaded file isn't used soon after the load event, so open DevTools after every change and look for it.

A lab measurement shows how preload can trade one metric against another. In one test run on throttled Chrome, preloading a font cut LCP from 1832 ms to 1360 ms but pushed First Contentful Paint from 992 ms to 1360 ms. The single number you're chasing can improve while another gets worse, so check both before you ship.

Choosing what deserves a preload comes down to knowing what sits in the first screen. A short guide on above-the-fold content helps you decide which assets are worth the high-priority slot. If LCP is your actual goal, a step-by-step walk through improving LCP puts preload in the context of the other fixes.

When prefetch earns its place

Prefetch fits where you can predict the next step with confidence: a landing page that leads to a sign-up flow, a product list that leads to a product page, a docs index that leads to a handful of articles. You fetch the next page's script or stylesheet while the visitor reads, so the next click feels instant.

In the same lab setup, prefetching a 219,377-byte product-page script let the next page paint at 500 ms instead of 1756 ms. The prefetch itself finished at a low priority and didn't compete with the current page. One lab run isn't a promise for your site, but it shows what the hint is for.

A few rules keep prefetch from hurting:

Browser support matters as well. web.dev notes that prefetch works in all modern browsers except Safari, where it sits behind a flag, and browsers may ignore it based on network quality or system preferences. That's fine for an optional hint, and it's another reason never to rely on it.

Prefetching whole pages: speculation rules

For next-page documents, MDN recommends the Speculation Rules API where it's supported over rel="prefetch". Chrome's guide says it suits static pages that change rarely and are cheap to produce, that prefetch is the more conservative option compared with prerender because it uses fewer client and server resources, and that it shouldn't be used on single-page applications. Keep rel="prefetch" for subresources like a next-page script and use speculation rules for the page itself.

dns-prefetch vs preconnect

These two aren't about downloading files. They prepare the connection to another origin, so the first request there doesn't pay for setup. Neither helps with your own origin, since that connection is already open.

The choice is simple. Preconnect the one to three third-party origins that your first screen can't render without, like the font host or the image CDN. Use dns-prefetch for the long tail of other domains, such as analytics or embeds, and for outbound links your visitors are likely to click.

Why not preconnect everywhere? web.dev warns that the browser closes any preconnect not used within 10 seconds, and that too many preconnects consume bandwidth and cause contention. One case study reports that replacing seven dns-prefetch tags with four preconnects and two dns-prefetches cut LCP from 3.24 s to 2.71 s on a product page, which is a good example of choosing a few connections rather than adding more.

Use separate tags for the fallback pattern:

<link rel="preconnect" href="https://fonts.example.com" crossorigin>
<link rel="dns-prefetch" href="https://fonts.example.com">

web.dev explains that combining both values in one tag triggers a Safari bug that cancels the preconnect. The dns-prefetch line then acts as a fallback for browsers that don't support preconnect. Add crossorigin to the preconnect when the origin serves fonts or other CORS requests, because a connection opened without it can't be reused for them.

Both can also go in an HTTP header instead of the HTML, for example Link: <https://fonts.googleapis.com/>; rel=dns-prefetch, as MDN shows. If a connection hint seems to do nothing, slow DNS is sometimes the real cause. Our DNS troubleshooting commands help you tell the two apart. And if you want to see why connection setup costs what it does, the notes on HTTP/2 vs HTTP/3 and on HTTP keep-alive explain connection reuse.

Mistakes that make hints backfire

The same few errors turn up repeatedly.

The first is a missing or wrong as or crossorigin. The Web Almanac data shows missing or invalid as values causing duplicate downloads or ignored preloads, and among preloads with missing or incorrect crossorigin, 63.6% involved font files. If your waterfall shows the same font twice, start there.

The second is using prefetch as a fallback for preload. They serve different purposes and, as Addy Osmani warned, often cause double fetches when combined that way.

The third is preloading something the page uses late or never. Preload costs bandwidth and a high-priority slot immediately, and the payoff only exists if the file is used. Hints that duplicate what the HTML parser already finds early are also dead weight.

The fourth is ignoring caching. A prefetched file that the server marks uncacheable is fetched and discarded. If you're debugging a hint that has no effect, look at the response before you look at the markup. The HTTP header inspection in our free tools shows the headers a URL returns, so you can see whether the Cache-Control value allows the file to be reused. For measuring wasted transfer in automated runs, there's also a piece on measuring headless browser bandwidth.

Measuring whether a hint helped

Adding a hint and watching Core Web Vitals move afterwards proves little, since anything else deployed that week could be responsible. A controlled approach works better: change one hint at a time, compare against a fixed baseline, repeat the runs on cold and warm cache, and judge each hint by the delivery gain it brings minus the connection, bandwidth and priority it costs. That's the method laid out in a measurement-led audit guide.

In practice:

  1. Record a baseline with throttled network and CPU in DevTools, several runs.
  2. Add one hint.
  3. Repeat the runs and compare LCP, FCP and total bytes, not just the one you were targeting.
  4. Watch the console for unused-preload warnings.
  5. Keep it only if the gain survives repeated runs.

Expect modest gains from a well-chosen hint. Shopify reported that on pageviews where browsers received and used its Early Hints preloads, LCP improved by 68 ms at the median and 145 ms at the 90th percentile. Tens or low hundreds of milliseconds across all visitors is a realistic outcome.

Keeping the page up while you tune it

Performance work often means touching headers, CDN rules and third-party origins, and any of those can break a page quietly. Pingfloat's Website Uptime Monitor checks that your site stays available, and the SSL Checker confirms a certificate is valid on origins you preconnect to or serve from. Core tools work without installation or an account, and the full set, including traceroute and header inspection, is on the Pingfloat home page.

Pingfloat

When a new hint coincides with a spike in errors or slow responses, the monitor's history tells you whether the site really was down or just slow, which saves you from rolling back a change that wasn't the cause.

Our view on resource hints

We build tools that show developers what a site is really doing, and resource hints are a case where the evidence beats the folklore. A hint is a prediction, and predictions need checking against what the server actually returns.

Our advice is to start with the response. Inspect the headers, confirm the cache policy, confirm the certificate on every origin you plan to connect to early, and only then decide which two or three preloads and which one or two preconnects belong in the head. Most pages need fewer hints than they have.

That's why we keep these checks free and instant. Header inspection, SSL checks, traceroute and uptime monitoring sit side by side, so a performance experiment doesn't need a separate setup. The Pingfloat Public API is there if you'd rather script the checks into your own pipeline.

Andreas

FAQ

Can I use preload and prefetch for the same file?

Usually no. They solve different problems, and using prefetch as a fallback for preload tends to cause double fetches. If the current page needs the file, preload it. If only a later page needs it, prefetch it.

Do preconnect and dns-prefetch have to be at the top of the head?

They work best early, because the point is to start connection work before the browser would discover the origin on its own. You can also send them as an HTTP Link header, which arrives before the HTML body is parsed.

Does prefetch work in Safari?

Not by default. web.dev notes that prefetch is available in Safari only behind a flag, so treat it as a progressive enhancement. The page must work the same without it.

Should I preconnect to my own domain?

No. Preconnect and dns-prefetch only help with cross-origin servers, because the connection to your own origin is already open when the page loads. Spend them on the third-party hosts for fonts, images or scripts that your first screen depends on.

Sources