coderef

Fetch priorityBaseline · Newly available

The fetch() priority option and the fetchpriority HTML attribute give hints to the browser about which requests to do before other requests of the same type.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Oct 29, 2024.

Browser support

DesktopChrome
1–102Not supported
103+Supportedsince Jun 21, 2022
Current: 155
Edge
12–102Not supported
103+Supportedsince Jun 23, 2022
Current: 154
Firefox
1–131Not supported
132+Supportedsince Oct 29, 2024
Current: 157
Safari
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27
MobileChrome Android
18–102Not supported
103+Supportedsince Jun 21, 2022
Current: 155
Firefox Android
4–131Not supported
132+Supportedsince Oct 29, 2024
Current: 157
Safari iOS
1–17.1Not supported
17.2+Supportedsince Dec 11, 2023
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Oct 29, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: fetchPriority.

Feature detection

JS · check before using
if ("HTMLImageElement" in globalThis && "fetchPriority" in HTMLImageElement.prototype) {
  // HTMLImageElement.fetchPriority is available
}

Sub-features

Support for each part of the feature (12). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLImageElement.fetchPriority10210213217.210213217.2
HTMLLinkElement.fetchPriority10210213217.210213217.2
HTMLScriptElement.fetchPriority10210213217.210213217.2
Request.Request.options_parameter.priority10110113217.210113217.2
fetch.options_parameter.priority10110113217.210113217.2
img.fetchpriority10110113217.210113217.2
link.fetchpriority10110113217.210113217.2
script.fetchpriority10110113217.210113217.2
http.headers.Link.fetchpriority10310313217.210313217.2
feImage.fetchpriority✕✕140✕✕140✕
image.fetchpriority✕✕140✕✕140✕
script.fetchpriority✕✕140✕✕140✕