Re: [whatwg] exposing dependencies + weights (aka, priorities) to web developers
Hey, Thanks for writing this up! So to the extent we are simply exposing http/2 semantics, this spec seems pretty clear. Two questions that I have that aren't answered by the http/2 spec: - What do we expect the browser to do with priorities set cross domain. Eg, if I express that a.com/foo.js depends on b.com/bar.js, does the browser do anything about this. What if b.com/bar.js depends on a.com/blah.js. Would we tell a.com that foo.js depends on blah.js? - Developers might have something they would want to speculatively fetch only if http/2 is being used (and therefore they know the resource won't compete for bandwidth with other resources). Maybe this could be solved by simply allowing the user to tell if the browser supports http/2. A more advanced solution could be to allow the user to say don't send this fetch request unless it's over http/2. One other thing I didn't see any mention of in the write up -- it could be useful to change priority while the request is in flight. http/2 supports this, so it'd be great if this spec could expose it. On Thu, Aug 14, 2014 at 6:16 PM, Ilya Grigorik igrigo...@gmail.com wrote: (followup / continuation of [1]) Trying to hash out some ideas for how to connect Fetch and the new transport capabilities of HTTP/2. Would love to hear everyone's thoughts: https://docs.google.com/document/d/1jSpWc6jkrUoYtGWcxev9Blkkv9RhoO1XtqinBvXqhgY/edit ig [1] http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2014-July/297257.html
Re: [whatwg] exposing dependencies + weights (aka, priorities) to web developers
On Fri, Aug 15, 2014 at 8:38 AM, Ben Maurer ben.mau...@gmail.com wrote: Hey, Thanks for writing this up! So to the extent we are simply exposing http/2 semantics, this spec seems pretty clear. Two questions that I have that aren't answered by the http/2 spec: - What do we expect the browser to do with priorities set cross domain. Eg, if I express that a.com/foo.js depends on b.com/bar.js, does the browser do anything about this. What if b.com/bar.js depends on a.com/blah.js. Would we tell a.com that foo.js depends on blah.js? Sure, the browser will take this into account in some ways, but not others. I wouldn't think about it too much, because given the level of the primitive being provided, this is an abstraction boundary that authors shouldn't cross. But yes, the browsers will leverage the information somewhat. More or less depending on the circumstances. Sorry for being vague :) If you need more exact controls, we probably need to expose lower level primitives. - Developers might have something they would want to speculatively fetch only if http/2 is being used (and therefore they know the resource won't compete for bandwidth with other resources). Maybe this could be solved by simply allowing the user to tell if the browser supports http/2. A more advanced solution could be to allow the user to say don't send this fetch request unless it's over http/2. Well, your server already knows about the http/2 support from the ALPN negotation, so it can emit different client code based on that. But if you want the logic to be in the client, then yes, the client must be able to detect http/2 support. There have been proposals on public-web-perf@ for that, and this reminds me that I promised Google web devs to push again for this. So, yeah, we should do that. One other thing I didn't see any mention of in the write up -- it could be useful to change priority while the request is in flight. http/2 supports this, so it'd be great if this spec could expose it. +1, although I don't know if Ilya was trying to subsume everything into this doc. On Thu, Aug 14, 2014 at 6:16 PM, Ilya Grigorik igrigo...@gmail.com wrote: (followup / continuation of [1]) Trying to hash out some ideas for how to connect Fetch and the new transport capabilities of HTTP/2. Would love to hear everyone's thoughts: https://docs.google.com/document/d/1jSpWc6jkrUoYtGWcxev9Blkkv9RhoO1XtqinBvXqhgY/edit ig [1] http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2014-July/297257.html
Re: [whatwg] exposing dependencies + weights (aka, priorities) to web developers
On Thu, 14 Aug 2014, Ilya Grigorik wrote: Trying to hash out some ideas for how to connect Fetch and the new transport capabilities of HTTP/2. It would be great to get a set of use cases describing what your proposal is addressing, since that would more easily let people evaluate whether it's worth doing, and if so, whether this proposal does it. -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] exposing dependencies + weights (aka, priorities) to web developers
Some cases I can think of off the top of my head: - A website has a page where media is the primary content. It would like to make sure that media is downloaded before JS (example: you go to flicker.com/my-image, the browser should probably prioiritize that image over a pice of javascript that is not critical to the user's interaction with the page). - A website knows there's a piece of Javascript code that the user might need if they click on a part of the page. The developer would like to have the user download it, but not at the expense of other resources. - A website is prefetching photos in a photo album and would like to make sure these images are lower priority than images the user is actually viewing. On Fri, Aug 15, 2014 at 9:17 AM, Ian Hickson i...@hixie.ch wrote: On Thu, 14 Aug 2014, Ilya Grigorik wrote: Trying to hash out some ideas for how to connect Fetch and the new transport capabilities of HTTP/2. It would be great to get a set of use cases describing what your proposal is addressing, since that would more easily let people evaluate whether it's worth doing, and if so, whether this proposal does it. -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
[whatwg] exposing dependencies + weights (aka, priorities) to web developers
(followup / continuation of [1]) Trying to hash out some ideas for how to connect Fetch and the new transport capabilities of HTTP/2. Would love to hear everyone's thoughts: https://docs.google.com/document/d/1jSpWc6jkrUoYtGWcxev9Blkkv9RhoO1XtqinBvXqhgY/edit ig [1] http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2014-July/297257.html