The priority
read-only property of the Request
interface contains the hinted priority of the request relative to other requests.
Request.priority
Value
A USVString
indicating the hinted priority of the request. Possible values are:
-
high
: Fetch the request at a high priority relative to other requests of a similar type. -
low
: Fetch the request at a low priority relative to other requests of a similar type. -
auto
: Default mode, which indicates no preference for the fetch priority. The browser decides what is best for the user.
Examples
In the following snippet, we create a new request using the Request()
constructor (for an API endpoint) at a low priority, then save the priority of the request in a variable:
var myRequest = new Request('/background-api-call', {priority: 'low'}); var myPriority = myRequest.priority; // "low"
Specifications
Specification |
---|
Priority Hints # fetch-integration |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
priority |
101
|
101
|
No
|
No
|
No
|
No
|
101
|
101
|
No
|
No
|
No
|
No
|
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Request/priority