I think there would be value in exposing a way to manually specify the priority of resource requests. Both via HTML (perhaps using a
priority attribute) and via JS (fetch() prioritization). The attribute based approach could be helpful for when you need to load resources with a particular priority before any JS is run at all.
Today, we have
<link rel=preload>, however
as is often not powerful enough to specify the correct priority. Browsers, even with the
async attribute on scripts, don’t allow us to control the exact priority we may like these resources to be fetched with.
<script priority> etc. could enable this.
Outside of the declarative approach to this problem, it would be useful to define priorities when
fetch()ing resources in JS. Jake Archibald has kicked around some ideas for how to do this using a Fetch Controller (e.g
Would manual priority control be a valuable capability to explore for the web?
I think the “how” of priority control is definitely up for debate. There may be more value in steering away from labels but offering a way to declare some resources as more or less important than others. That would allow the UA to decide how priorities should be set when priorities for H/2, QUIC etc are also to be considered.
The goal with this is to offer something lower-level than
Thoughts and opinions welcome