Preload, Preconnect, and Prefetch Explained

Speed & Performance2 min readBy the Monopage team

Browsers discover files as they read a page, which means some important files are found late. Resource hints let you tell the browser about them sooner. Used carefully, they can speed up key parts of a page. Used carelessly, they waste bandwidth and can make things slower.

Preload

Preload tells the browser to fetch a specific file early because the current page will need it soon. It suits files that are important but not discovered right away, such as:

  • A hero image set by CSS
  • A key web font
  • A critical script or stylesheet loaded late

Use it for only a few key files. Every preloaded file competes with others for bandwidth. If you preload something that is not needed soon, you slow down more important things. When preloading a font, remember the specific requirements for cross-origin font requests.

Preconnect

Before downloading from another domain, the browser must look up the address, open a connection, and set up security. Preconnect asks the browser to do that setup early. It helps when you know you will load important files from another domain, such as a font host or a CDN. See what is a CDN and do you need one and how DNS works.

Preconnect only to a couple of origins that matter. Each open connection has a cost, and unused connections are wasted.

DNS prefetch

A lighter version that only performs the address lookup. It can be a cheap hint for less important third-party domains.

Prefetch

Prefetch is different: it fetches a file that the next page might need, at low priority when the browser is idle. For instance, you might prefetch the checkout page's resources once someone adds a product to the cart. It can make navigation feel instant, but it uses bandwidth and data, so be conservative, especially on mobile.

Fetch priority

The fetchpriority attribute lets you mark an image as high priority, which is often useful for the main image that counts as your largest content. It can help your LCP image get fetched sooner. Do not mark many things high, or none will stand out. See how to improve Largest Contentful Paint.

A sensible approach

  1. Find your largest content element and make sure it is discoverable in the HTML. See lazy loading images explained and do not lazy load the main image.
  2. Preload only what the browser would find late.
  3. Preconnect to the one or two third-party origins you rely on early.
  4. Remove hints for resources you no longer use.
  5. Test whether each hint helps. See how to find what is slowing down your page.

Support differs

Browsers support these hints to different degrees and handle them in different ways, so test on more than one browser.

Common mistakes

  • Preloading too many files
  • Preloading something that is never used
  • Preconnecting to many domains
  • Using hints instead of removing slow third-party scripts

For images that suit different screens, see responsive images: srcset and sizes.