Skip to main content

Resource Hints Generator

Add URLs, choose hint types and resource types, then copy the generated HTML link tags or HTTP Link response headers. Supports preload, prefetch, preconnect, dns-prefetch, and modulepreload.

✓ HTML link tags ✓ HTTP Link headers ✓ CORS / as attribute

Add Resource

Quick Add Presets

Frequently Asked Questions

What is the difference between preload and prefetch?▼

preload fetches a resource needed for the current page with high priority — use it for fonts, hero images, and critical scripts that are discovered late. prefetch fetches a resource likely needed for the next navigation with low priority — use it for assets of the next page in a user journey. preload improves current page performance; prefetch improves future page performance. Preloaded resources that aren't used within a few seconds trigger a browser warning.

What does preconnect do and when should I use it?▼

preconnect establishes a TCP connection, TLS handshake, and DNS lookup to an origin in advance, saving 100–500ms of latency when that origin is first requested. Use it for critical third-party origins you know will be needed soon (CDN, Google Fonts, analytics). Limit to 2–3 preconnects — each one reserves a socket and consumes resources. For origins you're less certain about, use dns-prefetch instead (DNS only, cheaper).

What is modulepreload and how is it different from preload?▼

modulepreload is purpose-built for ES modules. Unlike preload (which fetches and stores), modulepreload also parses the module, compiles the JavaScript, and registers it in the module map — so when the module is imported, it's instantly available with zero parsing overhead. Use modulepreload for your main JS entry points (app.js, chunks). It's supported in all modern browsers. Regular preload with as=script doesn't give the same compile-time benefit for modules.

What is the 'as' attribute and why does it matter for preload?▼

The as attribute tells the browser what type of resource is being preloaded, which affects request priority, cache matching, and Content Security Policy enforcement. Without it, the browser fetches with lowest priority. Values: script, style, font, image, fetch, document, track, worker. For fonts, always include crossorigin='anonymous' — even same-origin fonts need it because fonts use CORS. Missing crossorigin causes a double download.

How do I use resource hints in HTTP headers vs HTML?▼

Resource hints work in both HTML link tags and HTTP Link response headers. HTTP Link headers have a slight advantage: they're processed before HTML parsing begins, giving a tiny head start. Use HTTP headers for preconnect and preload on the initial HTML document. Example: Link: </fonts/myfont.woff2>; rel=preload; as=font; crossorigin. Most CDNs and servers (Nginx, Cloudflare, Vercel) support Link headers via config or response headers.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →