Course contentsShow
← Web Development
Lesson 1969 of 2,98236. Performance Optimization TechniquesFree lesson

Resource Hint Priorities

Understand browser priority levels for different hint types and how they affect resource loading order.

Resource Hint Priorities

You'll learn how browsers prioritize different resource hints and how this affects the actual loading sequence of your assets.

What Are Resource Hint Priorities?

Not all resource hints are created equal in the browser's eyes. When you use multiple dns-prefetch, preconnect, prefetch, preload, and modulepreload hints, the browser assigns each a priority level that determines when and how aggressively it fetches those resources. Understanding these priorities helps you avoid accidentally delaying critical resources.

The Priority Hierarchy

Think of resource priorities like airport security lanes: some passengers get expedited treatment while others wait in the standard queue.

High Priority:

  • preload - Treated as critical, current-page resources. The browser fetches these early and aggressively.
  • modulepreload - Similar high priority for ES modules needed now.

Medium Priority:

  • preconnect - Establishes connections but doesn't transfer data yet. Less urgent than actual resource fetches.

Low Priority:

  • prefetch - Explicitly marked as "future navigation" resources. Browsers fetch these during idle time with lowest priority.
  • dns-prefetch - Minimal work, happens opportunistically.

Why This Matters

If you accidentally prefetch a critical stylesheet, the browser will defer it, breaking your page. Conversely, preloading dozens of non-critical images wastes bandwidth that should go to your main content.

The as attribute in preload also affects priority—as="style" gets higher priority than as="image", mirroring how browsers naturally prioritize CSS over images.

Practical Impact

Overusing high-priority hints creates congestion, like too many cars in the fast lane. Use preload sparingly for truly critical resources, and prefetch for future-page assets the user will likely need next.

Key Takeaway: Resource hints have different browser priority levels—preload is high priority for current needs, prefetch is low priority for future needs, and mixing them incorrectly can hurt performance instead of helping it.