Preload and preconnect.
Fetch before the browser knows.
Resource hints tell the browser about resources before it discovers them in the HTML. preload says "we need this now, fetch it first." preconnect says "we'll need this domain, open a connection." prefetch says "we'll need this later, fetch in idle time." Each one saves real time — but used incorrectly, they hurt more than help. This page covers when each one is appropriate.
Short answer: Use rel="preconnect" for the 2–3 third-party domains you'll definitely fetch from (fonts, CDN, API). Use rel="preload" for the 1–2 critical resources needed for first paint — usually the main font and the hero image. Use rel="dns-prefetch" as a fallback for older browsers. Use rel="prefetch" for the next page in a user flow. Too many hints compete for bandwidth and slow down everything.
✅ The four resource hints
Each one solves a different problem.
rel="preload"
Fetch a resource the current page needs. High priority. For critical fonts, CSS, images above the fold. Use 1–3 max.
rel="preconnect"
Open a connection to a domain (DNS + TCP + TLS). For third-party APIs, fonts, CDNs. Use 2–3 max.
rel="dns-prefetch"
DNS lookup only. Cheaper than preconnect. Fallback for older browsers, or extra domains beyond the preconnect limit.
rel="prefetch"
Fetch a resource for a future page. Idle-time download. For the next step in a flow — cart → checkout.
✅ Before and after
The same page, without and with resource hints.
<head> <meta charset="UTF-8"> <link rel="stylesheet" href="/style.css"> </head> <body> <h1 style="font-family: 'Inter', sans-serif;">Hello</h1> <img src="/hero.jpg" alt="Hero" width="1200" height="600"> <script src="https://cdn.example.com/analytics.js"></script> </body>