What is resource prioritization in browsers?
Answer
Browsers assign priorities to resource fetches based on type and location. High priority: HTML, CSS (render-blocking), scripts at head, fonts, preloaded resources. Medium: images in viewport, regular scripts, AJAX. Low: images offscreen, scripts with defer. Fetch Priority API (priority hints): explicitly set priority: <img fetchpriority="high" src="lcp-hero.jpg"> for the LCP image. <script fetchpriority="low" src="analytics.js">. <link rel="preload" as="script" fetchpriority="low"> for less critical preloads. LCP image priority: the LCP image should be fetchpriority="high" — the browser's default priority for above-fold images may not be high enough. Importance of prioritization: browsers have limited concurrent connections even with HTTP/2 multiplexing. Correct prioritization ensures the resources that affect user perception (LCP element, interactive scripts) download first. Browser priority is often correct by default — only override when you have specific knowledge that the browser's heuristics are wrong for your page.
Previous
What is layout thrashing and how do you avoid it?
Next
How does SSR (Server-Side Rendering) improve performance?
More Web Performance Questions
View all →- Intermediate How do you optimize React applications for performance?
- Intermediate What is the browser performance API and how do you measure performance?
- Intermediate What is layout thrashing and how do you avoid it?
- Intermediate How does SSR (Server-Side Rendering) improve performance?
- Intermediate What is a performance budget?