web-performance-optimization
/

Resource Hints in Web

Last Sync: Today

On this page

10
0%
5 min read
Remaining
5 minleft

Click any section to jump — progress syncs automatically

web-performance-optimization

Resource Hints in Web

What are Resource Hints?

Resource hints are directives that help the browser decide which resources to load earlier or prepare in advance.

Why Resource Hints Matter

They reduce latency and improve page load speed by optimizing how and when resources are fetched.

Types of Resource Hints

HintPurpose
preloadLoad critical resources immediately
prefetchLoad resources for future navigation
preconnectEstablish early connection to server
dns-prefetchResolve DNS early

Preload Example

HTMLRead-only
1
<link rel="preload" href="style.css" as="style">

Prefetch Example

HTMLRead-only
1
<link rel="prefetch" href="next-page.html">

Preconnect Example

HTMLRead-only
1
<link rel="preconnect" href="https://example.com">

DNS Prefetch Example

HTMLRead-only
1
<link rel="dns-prefetch" href="//example.com">

Best Practices

  • Use preload only for critical resources
  • Use prefetch for next-page assets
  • Use preconnect for external domains
  • Avoid excessive resource hints

Common Mistakes

  • Overusing preload causing network congestion
  • Using prefetch for critical resources
  • Ignoring priority levels
  • Not testing performance impact

Conclusion

Resource hints help browsers load resources smarter and faster. When used correctly, they significantly improve performance and user experience.

Try it yourself

<link rel="preload" href="style.css" as="style">

Test Your Knowledge

Q1
of 3

Which loads critical resources?

A
prefetch
B
preload
C
dns-prefetch
D
preconnect
Q2
of 3

Which prepares future navigation?

A
preload
B
prefetch
C
dns-prefetch
D
async
Q3
of 3

Which resolves DNS early?

A
preload
B
prefetch
C
dns-prefetch
D
defer

Frequently Asked Questions

What is preload?

It loads important resources early.

What is prefetch?

It loads resources for future use.

What is preconnect?

It establishes early connection to a server.

Previous

web http2 http3

Next

web performance tools

Related Content

Need help?

Explore our comprehensive docs or start a chat with our tech experts.