HTMLIFrameElement.fetchPriority

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The fetchPriority property of the HTMLIFrameElement interface represents a hint given to the browser on how it should prioritize the fetch of the iframe document relative to other iframe documents.

Value

A string representing the priority hint. Possible values are:

high

Fetch the iframe document at a high priority relative to other iframe documents.

low

Fetch the iframe document at a low priority relative to other iframe documents.

auto

Default mode, which indicates no preference for the fetch priority. The browser decides what is best for the user.

The fetchPriority property allows you to signal high or low priority iframe document fetches. This can be useful when applied to <iframe> elements to signal iframes that are "less-important" to the user experience early in the loading process.

The effects of the hint on resource loading is browser-specific so make sure to test on multiple browser engines.

Use it sparingly for exceptional cases where the browser may not be able to infer the best way to load the iframe automatically. Over use can result in degrading performance.

Examples

const iframe = document.createElement("iframe");
iframe.fetchPriority = 'low';
iframe.src = "/";

Specifications

Specification
Priority Hints
# iframe

Browser compatibility

BCD tables only load in the browser