Reference guide · performance · Published 2026-08-16 · 3 min read

Preconnect and prefetch guide

Preconnect and prefetch guide: the difference between resource hints, when each helps, and how to avoid the wasted-bandwidth trap.

Flat editorial illustration showing a speedometer gauge with a rising needle, clean tick marks and small trailing dots.
Illustration: this article at a glance.

Preconnect, dns-prefetch, preload and prefetch are resource hints, not performance magic. Each one moves a future network step earlier, and each one carries a cost if it fires for an asset the page never uses. The art is knowing which hint fits which future.

The resource hints

HintWhat it doesCost if unused
dns-prefetchResolves the origin's DNSOne DNS lookup
preconnectDNS + TCP + TLS handshakeA socket per origin
preloadFetches an asset needed this page, nowBandwidth, priority
prefetchFetches an asset for a future pageBandwidth, cache pressure

When each wins

The trap

The classic blunder is preconnect-ing every third-party domain a site merely mentions. Each preconnect burns a socket and a TLS handshake even if the page never connects, which on many third-party embeds is exactly what happens. Rules:

Read the timing

A preconnect that helps shows in the Network timeline: the first request to that host starts at time zero instead of after a 200 ms handshake. A preconnect that wasted its work shows a socket to a host the page never contacts, and Lighthouse flags nothing because the hint fired anyway.

When to involve a professional

If the page is slow and the Network sheet shows fifteen preconnects that each fired a socket and each never connected, sizing the hint set is a single audit, not a guess. A performance engineer can build the exact hint list from the HTML document by matching each hint to a real fetch.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services