Request.priority
The priority
read-only property of the Request
interface contains the hinted priority of the request relative to other
requests.
Value
A string indicating the hinted priority of the request. Possible values are:
high
-
The request is at a high priority relative to the other requests of a similar type.
low
-
The request is 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
BCD tables only load in the browser