-
Notifications
You must be signed in to change notification settings - Fork 4
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
Inspiration from/comparison to Priority Hints #12
Comments
Thank you for starting the discussion. I agree that by working together we could provide website owners more flexibility to control prioritization. Am I correct in assuming that Chrome maps Assuming that is the case, the most straightforward way would be to map them to If we are to go further than that, Priority Hints might allow arbitrary text to be set in the "importance" element, that when neither "high" or "low", gets appended to the value of the Priority header. For example, WDYT? |
A simple (rhetorical) clarification question: are priorirty hints expected to be seen "on the wire". From https://wicg.github.io/priority-hints/#examples-0
So this is a origin -> client header flow. But representation of this information in headers, in the other direction, are not supported (yet)? |
That is my understanding. Priority Hints are just hints that (might) affect how the browser builds the H2 prioritization tree. |
afaict, yes, these are hints from the origin to the client. However, like I said in the original post, I feel that maybe there are opportunities that these can be combined somehow, though that would have to be more fine-grained than just the high/low they have now. However, that's something they have been very hesitant about in the design. They explicitly did not want people setting too fine-grained settings (e.g., set the H2 weight directly). While I do personally like Kazuho's proposal of something like I'm also not sure the mapping you propose is something we would want Kazuho: |
Generally speaking, I think that it is a good idea to allow web developers specify priorities in fine-grained manner. Therefore, IMO it would be beneficial to define (or suggest) how Priority Hints would be converted to the Priority header, even if it remains just to be "high"s and "low"s. That would help us gain consistency between the browsers. At the same time, I agree that the most preferable way would be let users specify in the HTML tag the values to be embedded in the Priority header.
I'd appreciate it if somebody familiar with Chrome could clarify the exact mapping, but I think that generally speaking, the mapping from the importance attribute to the value of Priority header would (should) depend on the type of the resource. Consider the case of a CSS file that block rendering. The default urgency is "blocking." For such a resource, I do not think that having "importance" set to "high" ending up lowering the urgency makes sense. Therefore, the mapping of "importance=high" should at least be "urgency=blocking". OTOH, I do agree that mapping of images with "importance" set to "high" should not be as high as "urgency=blocking", because there is no point in serving an image before serving the img tag that refers to the image. WDYT? |
Priority Hints (https://wicg.github.io/priority-hints/) are a proposal to allow developers to indicate relative importance of resources in order to promote or demote their relative priorities directly in the HTML.
For example:
<img src="img/carousel-1.jpg" importance="high">
The way this is currently implemented in Chromium:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.cc?sq=package:chromium&g=0&l=195
This seems relatively straightforward, though according to @yoavweiss, they might make it more fine-grained (e.g., also add queueing/delaying of requests).
I am creating an issue for this mainly because I see a bit of overlap in the concepts of Priority Hints and this draft (though the "hints" move in different directions). Maybe it's interesting to think about a single, unified mechanism (or maybe not).
The text was updated successfully, but these errors were encountered: