-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchPriority enabled by default in Firefox 132 #24518
Open
acreskeyMoz
wants to merge
5
commits into
mdn:main
Choose a base branch
from
acreskeyMoz:fetch_priority_firefox
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9632404
fetchPriority enabled by default in Firefox 132
acreskeyMoz 4aa7eba
Request.init_priority_parameter
hamishwillee 3105e91
HTTP 103 status - add fetchpriority
hamishwillee dd5a9e8
HTTP 103 - add the tag for priority
hamishwillee 198e1cc
LINK header mirror link element
hamishwillee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fred-wang This adds fetchpriority subfeature to 103 status. The values mirror those for the
<link>
feature - though for chrome this header wasn't implemented until 103, so I used that instead of 101 (which was the value used in link). Reasonable?My understanding is that this header may be sent by a server prior to returning the final resource to indicate resources that the browser is likely going to want to request early. So basically this might be used to tell the browser to start loading a resource at higher priority before it parses the resource and finds the
<link>
tag that suggests it should do so - right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether/when chrome or webkit implemented the 103 header, but yeah that seems reasonable.
I think your understanding is correct, but actually this is also true for e.g. 200 OK. The subtility here is that Early Hints can be sent before the final response has arrived, allowing resources to be loaded even earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chrome implemented 103 preloads (Safari only supports preconnects in 103 now, where fetchpriority is not relevant so can probably be ignored for now).
It appears from the WPT's that you added that Chrome doens't error on fetchpriority on 103s:
https://wpt.fyi/results/loading/early-hints/preload-fetchpriority.h2.window.html?label=experimental&label=master&aligned
But we don't think it does anything special with it.
To us in Chrome it doesn't really make sense here as 1) high priority requests will be requested right anyway as soon as these are seen in headers and 2) low priority requests really shouldn't be sent in 103 requests. Not sure if Firefox was thinking of specific use cases for this that I'm not seeing? Or if it was just easier to support it everywhere rather than carve out an exception for
link
headers?So you can argue it's "supported" in Chrome in that in that it won't error, but not sure if it's more confusing than useful to add in here?
CC: @pmeenan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fred-wang Can you comment on the point immediately above ^^^: Not sure if Firefox was thinking of specific use cases for this that I'm not seeing? Or if it was just easier to support it everywhere rather than carve out an exception for link headers?.
@tunetheweb My assumption here was that if a browser sees a Link header it would download it, but the priority would still be affected by settings like
preload
andfetchpriority
. In otherwords, if you have a lot of stuff to download, the additional prioritisation hint is still useful. I'm pretty ignorant of this stuff, so hopefully @fred-wang can clarify what he things support means for a browser.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks supporting fetchpriority in 103 came after a review by @mb and I believed it turned out that implementing the generic support for Link header implied support for 103 too. In https://bugzilla.mozilla.org/show_bug.cgi?id=1882084 in addition to the basic test mentioned we also check that fetchpriority affects our internal priority in 103 header. But I don't think we had any specific use case in mind besides supporting what's the spec says. So I agree, probably documenting support for the generic Link header is the right thing to do...