← All Tools

Resource Hints Builder

Generate <link rel="preload">, prefetch, preconnect, dns-prefetch, and modulepreload tags with the right as, type, crossorigin, fetchpriority, and media attributes. Live HTTP Link: header output and validity hints.

New hint

Hints (0)

HTML <head>

(no hints yet)

HTTP Link: header

Equivalent RFC 8288 response header — early-flush from your origin or CDN before the HTML body to start fetches sooner.

(no hints yet)

Reference

Which hint should I use?
HintWhenCost
preloadCritical sub-resources for this page (LCP image, web fonts, hero CSS the browser can't yet see). HighFetched immediately; wastes bytes if unused.
prefetchResources likely needed for the next navigation (link a user is hovering, prerendered route bundle). LowLow-priority idle fetch; cached for later.
preconnectYou will request from a 3rd-party origin soon and want DNS + TCP + TLS already done.One socket per origin; use sparingly (2–4 max).
dns-prefetchCheaper fallback to preconnect when you have many 3rd-party origins and just want the DNS resolved.Negligible.
modulepreloadAn ES module (and its dependency graph) you'll import shortly.Fetches the module + recursively follows static imports.
Required vs. forbidden attributes
relhrefascrossorigintype
preloadRequiredRequired — without it the browser can't prioritize and may double-fetch.Required for fonts (always anonymous); required for cross-origin fetch/script/style.Recommended for fonts & images so the browser can skip unsupported formats.
prefetchRequiredOptional (but recommended).Optional.Optional.
preconnectOrigin only (no path).Required if the origin will be hit with credentialed requests or for fonts.
dns-prefetchOrigin only.
modulepreloadRequired.For cross-origin modules.Always module implicit.
Pitfalls
  • Font without crossorigin: the browser preloads but can't reuse the response → the actual @font-face fetch starts from scratch. Always crossorigin="anonymous" for fonts, even same-origin.
  • as="image" with imagesrcset/imagesizes: required so the preload matches the eventual <img> selection, otherwise the browser fetches the wrong size.
  • preconnect without using the origin: wastes a socket the user paid for. Pair it with an actual request within ~10s.
  • Too many hints: each preload competes with the HTML, CSS, and JS the parser actually finds. Reserve preload for the 2–4 truly LCP-critical resources.
  • Module hint mismatch: modulepreload only matches ES modules — for classic scripts use preload as="script".