-
Notifications
You must be signed in to change notification settings - Fork 31
Header preload and CSS / JavaScript #116
Comments
To make it a little more explicit, it would be good to encourage folks to at least define |
@tmornini interesting discovery on HTTP 103. Let's discuss next time we speak. |
I can see other problems with early hints and preload (e.g. CSP & Referrer Policy), but the download of CSS and Javascript could be kicked off early without knowing their presumed charsets, assuming they are only parsed after the HTML starts arriving and the charset is known. |
That is a good point, we cannot really download them until we know the CSP and Referrer Policy... |
Another problem is cookies, which may not to be properly set, if the app relies on the HTML's response header to set them. |
@snuggs This seems like a MICRO OPTIMIZATION at best. Having a hard time imagining building anything where the body takes long enough to compute to make this worthwhile -- and how I'd know what hints to throw without fishing them out of the body in the first place. Perhaps if I sleep on it it'll make sense in the morning. 😄 |
@tmornini See https://blog.yoav.ws/being_pushy/ for the use-case and how it's handled with H2 server push. Theoretically early hints + preload can tackle the same use-case (with an RTT worth of extra delay). In practice, there are significant hurdles to surmount before that'll be implementable. |
@yoavweiss 👍🏻 |
Where I wrote:
Matches the concept of “server think time” in that article. For what it’s worth, I think 103 is a very bad idea. HTTP is fundamentally request/response. 103 makes it request/response-response-adinfinitun It adds complexity and makes HTTP harder to reason about. 👎🏻 |
HTTP has always had 1xx responses so this doesn't really change anything about HTTP. |
But also, this is getting rather off-topic. |
@annevk Fair enough 👍 |
Closing as there's nothing actionable here from preload's perspective. @annevk - feel free to reopen if you feel otherwise |
Part of OP would mean introducing a new feature, no? Also, reporters typically cannot reopen issues on GitHub as they don't have the authority... |
Also in general it seems these considerations need to be spelled out somewhere so new implementers are not led astray into making optimizations that are not doable. |
Adding a note to that effect seems reasonable. I'll reopen. Regarding the charset bits for:
Isn't that already possible with the (Admittedly, quirks mode may require a separate flag. I'm not convinced the potential optimization will encourage adoption of such a flag) |
I don't think a |
I agree that if we want to use that as a hint to the parser, we'd need to better tie these concepts in the spec. I'm currently not convinced there's a huge need for that. |
Going back to this after a long while (sorry!). Seems like the only actionable bit is to add a note that implementations should not start processing preloaded resources before: I think we should dive into |
To parse CSS you need to know quirks mode / no-quirks in advance and have an encoding. For JavaScript you also need an encoding. We could assume no-quirks and then throw away the results if it turns out to be quirks, but it would be good to have this explicitly tested to ensure implementations don't take the wrong shortcuts.
(We might also consider some kind of flag where the developer can give guarantees about the resource so the browser doesn't have to do things speculatively and potentially throw away results.)
The text was updated successfully, but these errors were encountered: