--- url: "https://web.dev/articles/fetch-priority" titulek: "Optimize resource loading with the Fetch Priority API | Articles | web.dev" h1: "Optimize resource loading with the Fetch Priority API Stay organized with collections Save and categorize content based on your preferences." popis: "The Fetch Priority API indicates the relative priority of resources to the browser. It can enable optimal loading and improve Core Web Vitals." jazyk: "en" kanonicka: "https://web.dev/articles/fetch-priority" drobecky: ["Articles", "Optimize resource loading with the Fetch Priority API"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 23:11:11" znaku: 19633 slov: 2900 kodovani: "iso-8859-2" sha256: "f65d38c1068d24fbb060914d526bf50d104384e8e7528c462be73759d4c28076" --- Optimize resource loading with the Fetch Priority API Stay organized with collections Save and categorize content based on your preferences. The Fetch Priority API indicates the relative priority of resources to the browser. It can enable optimal loading and improve Core Web Vitals. Addy Osmani Leena Sohoni Patrick Meenan Barry Pollard Browser Support 102 102 132 17.2 [Source](https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority) When a browser parses a web page and begins to discover and download resources such as images, scripts, or CSS, it assigns them a fetch `priority` so it can download them in an optimal order. A resource's priority usually depends on what it is and where it is in the document. For example, in-viewport images might have a `High` priority, and the priority for early loaded, render-blocking CSS using ``s in the `
` might be `Very High`. Browsers are pretty good at assigning priorities that work well but may not be optimal in all cases. This page discusses the Fetch Priority API and the `fetchpriority` HTML attribute, which lets you hint at the relative priority of a resource (`high` or `low`). Fetch Priority can help optimize the Core Web Vitals. Summary **A few key areas where Fetch Priority can help:** Boosting the priority of the LCP image by specifying `fetchpriority="high"` on the image element, causing LCP to happen sooner. Increasing the priority of `async` scripts, using better semantics than the current most common hack (inserting a `` for the `async` script). Decreasing the priority of late-body scripts to allow for better sequencing with images. Fetch Priority improving Largest Contentful Paint from 2.6 s to 1.9 s in a test of Google Flights. Historically, developers have had limited influence over resource priority using [preload](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preload) and [preconnect](https://developer.chrome.com/docs/lighthouse/performance/uses-rel-preconnect). Preload lets you tell the browser about critical resources you want to load early before the browser would naturally discover them. This is especially useful for resources that are harder to discover, such as fonts included in stylesheets, background images, or resources loaded from a script. Preconnect helps warm up connections to cross-origin servers and can help improve metrics like [Time to first byte](/articles/ttfb). It's useful when you know an origin but not necessarily the exact URL of a resource that will be needed. Fetch Priority complements these [Resource Hints](https://www.w3.org/TR/resource-hints/). It's a markup-based signal available through the `fetchpriority` attribute that developers can use to indicate the relative priority of a particular resource. You can also use these hints through JavaScript and the [Fetch API](/articles/introduction-to-fetch) with the `priority` property to influence the priority of resource fetches made for data. Fetch Priority can also complement preload. Take a Largest Contentful Paint image, which, when preloaded, will still get a low priority. If it is pushed back by other early low-priority resources, using Fetch Priority can help how soon the image gets loaded. Resource priority The resource download sequence depends on the browser's assigned priority for every resource on the page. The factors that can affect priority computation logic include the following: The type of resource, such as CSS, fonts, scripts, images, and third-party resources. The location or order the document references resources in. Whether the [`async` or `defer`](/articles/efficiently-load-third-party-javascript#use_async_or_defer) attributes are used on scripts. The following table shows how Chrome prioritizes and sequences most resources: Load in layout-blocking phase Load one-at-a-time in layout-blocking phase **Blink Priority** **VeryHigh** **High** **Medium** **Low** **VeryLow** **DevTools Priority** **Highest** **High** **Medium** **Low** **Lowest** Main resource CSS (early**) CSS (late**) CSS (media mismatch***) Script (early** or not from preload scanner) Script (late**) Script (async) Font Font (rel=preload) Import Image (in viewport) Image (first 5 images > 10,000px2) Image Media (video/audio) Prefetch XSL XHR (sync) XHR/fetch* (async) The browser downloads resources with the same computed priority in the order they're discovered. You can check the priority assigned to different resources when loading a page under the Chrome Dev Tools **Network** tab. (Make sure you include the **priority** column by right-clicking the table headings and ticking that). Priority for resource `type = "font"` on BBC news detail page Priority for resource `type = "script"` on BBC news detail page. When priorities change, you can see both the initial and final priority in the **Big request rows** setting or in a tooltip. Priority changes in DevTools. When might you need Fetch Priority? Now that you understand the browser's prioritization logic, you can tweak your page's download order to optimize its performance and [Core Web Vitals](/articles/vitals). Here are some examples of things you can change to influence the priority of resource downloads: Place resource tags like `` Effects of browser priority and `fetchpriority` You can apply the `fetchpriority` attribute to different resources as shown in the following table to increase or reduce their computed priority. `fetchpriority="auto"` (â) in each row marks the default priority for that type of resource. (also available [as a Google Doc](https://docs.google.com/document/d/1bCDuq9H1ih9iNjgzyAL0gpwNFiEP4TZS-YLRp_RuMlc/edit)). Load in layout-blocking phase Load one at a time in layout-blocking phase **Blink Priority** **VeryHigh** **High** **Medium** **Low** **VeryLow** **DevTools Priority** **Highest** **High** **Medium** **Low** **Lowest** Main Resource â CSS (early**) âŹâ ⏠CSS (late**) ⏠â ⏠CSS (media mismatch***) âŹ*** â⏠Script (early** or not from preload scanner) âŹâ ⏠Script (late**) ⏠â ⏠Script (async/defer) ⏠â⏠Font â Font (rel=preload) âŹâ ⏠Import â Image (in viewport - after layout) âŹâ ⏠Image (first 5 images > 10,000px2) ⏠â ⏠Image ⏠â⏠Media (video/audio) â XHR (sync) - deprecated â XHR/fetch* (async) âŹâ ⏠Prefetch â XSL â `fetchpriority` sets *relative priority*, meaning it raises or lowers the default priority by an appropriate amount, rather instead of explicitly setting the priority to `High` or `Low`. This often results in `High` or `Low` priority, but not always. For example, critical CSS with `fetchpriority="high"` retains the "Very High"/"Highest" priority, and using `fetchpriority="low"` on these elements retains the "High" priority. Neither of these cases involve explicitly setting priority to `High` or `Low`. Use cases Use the `fetchpriority` attribute when you want to give the browser an extra hint about what priority to fetch a resource with. Increase the priority of the LCP image You can specify `fetchpriority="high"` to boost the priority of the LCP or other critical images. `
` The following comparison shows the Google Flights page with an LCP background image loaded with and without Fetch Priority. With the priority set to high, the [LCP improved from 2.6s to 1.9s](https://www.webpagetest.org/video/compare.php?tests=211006_AiDcG3_40871b05d6040112a05be4524565cf5d%2C211006_BiDcHR_bebed947f1b6607f2d97e8a899fdc36b&thumbSize=200&ival=100&end=visual). An experiment conducted using Cloudflare workers to rewrite the Google Flights page using Fetch Priority. Lower the priority of above-the-fold images Use `fetchpriority="low"` to lower the priority of above-the-fold images that aren't immediately important, for example offscreen images in an image carousel. `