Intent to Ship: Priority Hints

211 views
Skip to first unread message

Patrick Meenan

unread,
Mar 3, 2022, 1:20:40 PMMar 3
to blink-dev

Contact emails

ad...@chromium.orgkenji...@chromium.orgpme...@chromium.org

Explainer

https://github.com/WICG/priority-hints/blob/main/EXPLAINER.md

Specification

https://wicg.github.io/priority-hints/

Summary

Priority Hints provide developers a way to indicate a resource's relative fetch priority to the browser, allowing more control over the order resources are loaded. Many factors influence a resource's priority in browsers. These include type, visibility, and preload status of a resource. Priority Hints introduces a developer-set "fetchpriority" HTML attribute and "priority" fetch property allowing developers to influence the computed priority of a resource fetch. Supported priority values are auto, low, and high.


By far, the biggest win during Origin Trials was for sites to be able to tag important images as high-priority so they could be fetched earlier without having to wait for layout (leading to substantial improvements in LCP). Details are in the linked OT feedback summary.

The only change during the spec process was a name change of the HTML/fetch attributes from "importance" to "fetchpriority" and "priority".

Web-dev article: https://web.dev/priority-hints/

Blink component

Blink>Loader

Search tags

priority-hintspriority hints

TAG review

https://github.com/w3ctag/design-reviews/issues/704

TAG review status

Issues addressed

Link to origin trial feedback summary

https://docs.google.com/document/d/162dym7j0PbpoMvle58gO9DDqpQFOvvmqwu1OIJ1IEzQ/edit?usp=sharing

Risks

Interoperability and Compatibility


Gecko: worth prototyping
WebKit: No signal
Web developers: Strongly positive
Other signals:

Debuggability

Resource fetch priority is exposed in dev tools as part of the network panel, in the netlog, in traces and in tools like WebPageTest.


Is this feature fully tested by web-platform-tests?

Yes

Flag name

Experimental Runtime Feature Flag: PriorityHints
Origin Trial: PriorityHintsAPI

Requires code in //chrome?

False

Tracking bug

https://crbug.com/821464

Estimated milestones

OriginTrial desktop last99
OriginTrial desktop first96
OriginTrial android last99
OriginTrial android first96

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5273474901737472

Links to previous Intent discussions

Intent to Experiment: https://groups.google.com/a/chromium.org/g/blink-dev/c/CkRq2zY-t6c

This intent message was generated by Chrome Platform Status.

Addy Osmani

unread,
Mar 3, 2022, 4:54:31 PMMar 3
to blink-dev, Patrick Meenan
Priority Hints introduces a developer-set "fetchpriority" HTML attribute and "priority" fetch property allowing developers to influence the computed priority of a resource fetch. Supported priority values are auto, low, and high.

Non-owner LGTM. Thanks once again for all of your work taking this feature through a reboot, Pat! The adjustment in attribute name adds some needed clarity to the expected behavior for web developers. I would be excited to see this feature ship.

On Thursday, March 3, 2022 at 10:20:40 AM UTC-8 Patrick Meenan wrote:

slightlyoff via Chromestatus

unread,
Mar 4, 2022, 5:21:30 PMMar 4
to blin...@chromium.org
LGTM1 Thank you for pushing this over the line. We've needed it for many years, and I'm glad it's finally happening.

Mike Taylor

unread,
Mar 4, 2022, 5:25:12 PMMar 4
to Addy Osmani, Patrick Meenan, blink-dev
This seems genuinely useful, thanks for working on it.

What's the current thinking on exposing `priority` on Request, i.e. https://github.com/WICG/priority-hints/issues/11#issuecomment-396610469?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/5817987a-0812-4c5c-b8cb-dce4dbbdd830n%40chromium.org.


Patrick Meenan

unread,
Mar 4, 2022, 5:35:54 PMMar 4
to Mike Taylor, Addy Osmani, blink-dev
I'm plumbing the support for the read-only priority property on Request now. 

It's a fair bit more complicated than I had hoped and requires plumbing through to net and the internal urlrequest but I'm making good progress. 

I don't think we want to hold shipping on that though. It's a nice-to-have addition but isn't needed for the vast majority of use cases. 

On Fri, Mar 4, 2022 at 5:25 PM Mike Taylor <mike...@chromium.org> wrote:
This seems genuinely useful, thanks for working on it.

What's the current thinking on exposing `priority` on Request, i.e. https://github.com/WICG/priority-hints/issues/11#issuecomment-396610469?

On 3/3/22 4:54 PM, Addy Osmani wrote:
Priority Hints introduces a developer-set "fetchpriority" HTML attribute and "priority" fetch property allowing developers to influence the computed priority of a resource fetch. Supported priority values are auto, low, and high.
Non-owner LGTM. Thanks once again for all of your work taking this feature through a reboot, Pat! The adjustment in attribute name adds some needed clarity to the expected behavior for web developers. I would be excited to see this feature ship.

On Thursday, March 3, 2022 at 10:20:40 AM UTC-8 Patrick Meenan wrote:

Patrick Meenan

unread,
Mar 4, 2022, 5:39:28 PMMar 4
to Mike Taylor, Addy Osmani, blink-dev
Here's the crbug for the priority property on Request if you'd like to follow along: https://crbug.com/1301942

The only use case that comes to mind is for a service worker to behave differently based on the requested priority (though if the same resource is requested multiple times on the page they will only see the first one so I'm not sure it's much help even in that case since priority changes aren't plumbed through worker callbacks).

Mike Taylor

unread,
Mar 4, 2022, 5:42:58 PMMar 4
to Patrick Meenan, Addy Osmani, blink-dev
Thanks - agree we don't need to block here, but glad to see it's on your radar as a future improvement.

LGTM2.

Yoav Weiss

unread,
Mar 7, 2022, 1:02:53 PMMar 7
to Mike Taylor, Patrick Meenan, Addy Osmani, blink-dev
LGTM3!!

Thanks so much for pushing this through, proving the benefits using an OT, and meticulously working out issues with other vendors. Looking forward to seeing this land! :)


Reply all
Reply to author
Forward
0 new messages