Re: [w3ctag/design-reviews] Priority Hints API (Issue #704)

On the standardization front, we have been bikeshedding on the feature for a few years in the web performance working group. The two common areas of contention are:

## The level of control over prioritization
Some would like more fine-grained control over fetch ordering and prioritization (lots of explicit levels, direct linkage to the underlying protocol priority support). The current disconnect from explicit prioritization is intentional and gives developers a level of control that aligns with what browsers, protocols and origins are actually able to support reliably.

Labeling images/scripts/frames/fetches as "more" or "less" important provides the hinting that browsers need that isn't organically available otherwise and is easy for site owners to understand without being overly complex (or opening up too big of a footgun).

## The attribute name
**importance** is the attribute that we landed on after LOTS of discussion and aligns well with the concept of "this is an important image" or "this fetch is less important".

* There are some concerns about the length of the attribute name but the values themselves are very short (high, low, auto) and when combined together, the resulting string length is in line with any other alternatives.
* ```importance``` is quite generic for something that is restricted to the fetch priority of the main resource for the relevant element.
 * We considered extending **loading** which is currently used for lazy-load but the existing "lazy" and "eager" attribute values don't work well when combined with importance values.
* There is concern that we are exploding the attributes on elements in a way that makes it more difficult for developers.
 *  We toyed with the idea of moving fetch-related hints into a ```fetch``` attribute but then it just moves the cognitive load to decoding the string parameters within the fetch attribute and doesn't actually make things any easier.
 
At the end of the day, ```importance=high/low/auto``` is the cleanest we could come up with for developers to indicate the importance of elements of similar types and for that importance to only manifest in the fetching of the resource needed for that element.  If, at some point in the future, we need a way to control the execution time of a script or the scheduling priority of tasks in an iframe, those would likely need something more explicit than an attribute with the name ```importance```.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/704#issuecomment-1026129907
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/704/1026129907@github.com>

Received on Monday, 31 January 2022 19:28:24 UTC