Enable "fetchpriority" feature by default
Categories
(Core :: Networking, task, P3)
Tracking
()
People
(Reporter: mbrodesser-Igalia, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [necko-triaged])
Attachments
(1 file)
Setting as P2 for pref flipping on nightly. Release status unclear ATM
Comment 2•1 year ago
|
||
Valentin, what do you think?
Comment 3•1 year ago
|
||
As a side note, once we're happy with this behaviour in nightly, I would really love to see a performance experiment run with this feature.
I believe this was called "PriortyHints" and looks to be growing in popularity recently, via the ChromeStatus view, about 12.5% of sites in August.
Assignee | ||
Comment 4•1 year ago
|
||
As far as I can tell we only implement fetch priority for script elements at the moment.
I don't think there's any risk to shipping this without supporting it for all elements, but I do expect some of the performance benefits won't be visible until we do so.
Reporter | ||
Comment 5•1 year ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #4)
As far as I can tell we only implement fetch priority for script elements at the moment.
Yes. The implementation for other elements is in progress, see the dependent bugs of https://bugzilla.mozilla.org/show_bug.cgi?id=1797715.
I don't think there's any risk to shipping this without supporting it for all elements, but I do expect some of the performance benefits won't be visible until we do so.
The fetchpriority
implementation for all elements is guarded behind the same pref. Each implementation will be landed in a separate patch or patches, in order to avoid local bit rotting. Therefore suggesting to enable the feature by default only once all implementations have landed.
Assignee | ||
Updated•9 months ago
|
Comment 6•9 months ago
|
||
Currently, the DOM part for fetchpriority is essentially complete.
At the end, we decided a safer approach for the "implementation-defined" part i.e. instead of following https://web.dev/articles/fetch-priority?hl=en#browser_priority_and_fetchpriority we are trying to keep Gecko's current behavior and we introduced network.fetchpriority.adjustments.*
preferences so that we can more easily experiment how we want to map fetchpriority
to internal priorities.
For now enabling the flag will only affect internal priority when fetchpriority=high/low is specified and for HTTP/2 requests.
I think it makes sense to try to enable the flag with the current implementation and then refine later the handling of priority mapping and network headers.
Anyway, for now I'll open a separate bug to enable the flag in nightly so we can start experimenting it a bit more.
Assignee | ||
Comment 7•2 months ago
|
||
Updated•2 months ago
|
Comment 9•2 months ago
|
||
Do you plan to send an intent to ship email to dev-platform@mozilla.org or should I send one ?
Assignee | ||
Comment 10•2 months ago
|
||
Hi Frédéric, I wouldn't mind if you sent it.
Here's the template: https://wiki.mozilla.org/ExposureGuidelines#Intent_to_ship
Thanks!
Comment 11•2 months ago
|
||
Comment 12•2 months ago
|
||
And we should flag this one for release notes too.
I can take care of getting https://caniuse.com/ updated.
Comment 13•2 months ago
|
||
bugherder |
Comment 14•2 months ago
|
||
(In reply to Andrew Creskey [:acreskey] from comment #12)
And we should flag this one for release notes too.
I think setting dev-doc-needed
is enough? Someone from MDN will take care of updating the BCD info, MDN articles, and Firefox release notes.
I can take care of getting https://caniuse.com/ updated.
Thanks!
Comment 15•2 months ago
|
||
(In reply to Frédéric Wang (:fredw) from comment #14)
(In reply to Andrew Creskey [:acreskey] from comment #12)
And we should flag this one for release notes too.
I think setting
dev-doc-needed
is enough? Someone from MDN will take care of updating the BCD info, MDN articles, and Firefox release notes.
Yes, I believe that is the case, but let's watch it carefully.
I can take care of getting https://caniuse.com/ updated.
This feature on caniuse is pulled frombrowser-compat-data/
https://github.com/mdn/browser-compat-data/pull/24518
Comment 16•2 months ago
|
||
Please add a relnote-firefox
request on this when you get a chance.
Comment 17•2 months ago
|
||
I'll take care of the relnote since I did the intent to ship (I guess valentin is ok with that)
Comment 18•2 months ago
•
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: New attributes on img/script/link, RequestInit and Link HTTP headers, affecting timing of resource loading.
[Suggested wording]: The fetchpriority
attribute enables web developers to optimize resource loading by specifying the relative priority of resources to be fetched by the browser. It accepts three values: auto
(default priority), low
(lower priority), high
(higher priority). It can be specified on script
, link
, img
elements, on the RequestInit
parameter of the fetch()
method and Link
response headers. The HTML specification leaves the detailed interpretation of this attribute up to implementers. Firefox will typically use it to increase or decrease the urgency parameter of HTTP/2 and HTTP/3 requests.
[Links (documentation, blog post, etc)]:
https://web.dev/articles/fetch-priority
https://notes.igalia.com/s/dGX-j1_7O#
https://frederic-wang.fr/2024/09/05/my-recent-contributions-to-gecko-fetch-priority/
https://firefox-source-docs.mozilla.org/networking/http/prioritization.html (bug 1915852)
https://html.spec.whatwg.org/#fetch-priority-attribute
https://html.spec.whatwg.org/#the-img-element:fetch-priority-attribute
https://html.spec.whatwg.org/#the-script-element:fetch-priority-attribute
https://html.spec.whatwg.org/#the-link-element:fetch-priority-attribute
https://fetch.spec.whatwg.org/#enumdef-requestpriority
https://html.spec.whatwg.org/#processing-link-headers:fetch-priority-attribute
https://www.rfc-editor.org/rfc/rfc9218.html#section-4.1
Comment 19•2 months ago
|
||
(In reply to Andrew Creskey [:acreskey] from comment #15)
I can take care of getting https://caniuse.com/ updated.
This feature on caniuse is pulled frombrowser-compat-data/
https://github.com/mdn/browser-compat-data/pull/24518
OK cool that will be less effort (that's what I meant by BCD, sorry). I checked on MDN/BCD and I think we might need to document a bit more. At least fetchattribute is not mentioned on the Link HTTP header https://github.com/mdn/browser-compat-data/pull/24518#pullrequestreview-2330188832 ; also found https://github.com/mdn/browser-compat-data/issues/20590 (bug 1847712).
Comment 20•2 months ago
|
||
(In reply to Frédéric Wang (:fredw) from comment #14)
(In reply to Andrew Creskey [:acreskey] from comment #12)
And we should flag this one for release notes too.
I think setting
dev-doc-needed
is enough? Someone from MDN will take care of updating the BCD info, MDN articles, and Firefox release notes.I can take care of getting https://caniuse.com/ updated.
Just to be clear, setting dev-doc-needed
is an indicator for the MDN team to update the info on the MDN website, while the relnote-firefox
flag is meant for the release notes team to add the feature to the https://www.mozilla.org/en-US/firefox/*/releasenotes/ page. And as far as I know, those two teams work independently from each other. (Someone please correct me if I'm wrong here!)
So, dev-doc-needed
should be added for all web features that require documentation for website authors. And relnote-firefox
should be requested if you believe it's worth to be mentioned in the general Firefox release notes.
Sebastian
Comment 22•1 months ago
|
||
(In reply to Frédéric Wang (:fredw) from comment #18)
[Suggested wording]: The
fetchpriority
attribute enables web developers to optimize resource loading by specifying the relative priority of resources to be fetched by the browser. It accepts three values:auto
(default priority),low
(lower priority),high
(higher priority). It can be specified onscript
,link
,img
elements, on theRequestInit
parameter of thefetch()
method andLink
response headers. The HTML specification leaves the detailed interpretation of this attribute up to implementers. Firefox will typically use it to increase or decrease the urgency parameter of HTTP/2 and HTTP/3 requests.
If we could ensure that we highlight the pageload performance impacts, I think our users would like to hear it :)
Something like:
"The fetchpriority attribute lets developers prioritize resource loading, ensuring that important assets load faster, improving page speed.
...
"
Comment 23•1 month ago
•
|
||
MDN docs work for this can be tracked in https://github.com/mdn/content/issues/36121
(:sebo) - you are correct (entirely) in https://bugzilla.mozilla.org/show_bug.cgi?id=1854077#c20 - dev-doc-needed
is the MDN flag, and the teams are independent. That won't stop me reusing some of the release note information. We replace that with dev-doc-complete
when the work is done so you know we think that it has been handled.
I don't know enough yet to useful comment on what I will be doing for this, but I may be back with questions after looking at the spec.
Updated•1 month ago
|
Description
•