You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 5, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 5, 2022. It is now read-only.
If the URL of a preload has gone through 301 redirect(s), can the load event know the final URL (so that a matching request later can request it correctly without the penalty of the redirects?
Alternately, does the load event have access to the response headers (for a same domain request)?
For example, let's say I preload an image URL, but the server signals that the content is actually an HTML page, it'd be nice to be able to know that after preload so that the matching request can be made with the appropriate container.
Both of these should by addressed by Fetch API... @annevk have we made any progress on API to retrieve the Response object for a request initiated by a markup element?
You mean as if it was made by an element? We don't really have that no. I think we should first have a way to populate such an element with a response and perhaps extract/modify its request. But all of those are kind of stalled lacking a good design...
Actually, I think at least one perspective is related specifically to preload... in one respect, preload is kind of like a preflight request that resolves a URL from requested to final... so I'd like to be able to know that final URL for the follow-on main resource request, rather than re-using the original URL.
Of course, that has implications on whether it would still be possible for the system to do "matching" if you used initial URL for preload and final URL for main resource request..
@getify you may not need to know that information, it depends on how we define 'matching'. If the matching is with respect to original request URL (which seems same, as otherwise we would catch a lot of developers off-guard), then you don't need to know the final URL or the headers. In fact, there are probably privacy / cross-origin restrictions that would prevent us from surfacing those bits anyhow.
@getify are you familiar with the Fetch registry proposal? FWIW, I think that's the right mechanism and place to solve the use cases you've outlined - e.g. access to headers, get final URL, etc.
Closing this thread, let's continue the discussion on the w3 tracker. That said, feel free to reopen this if you feel otherwise.
Activity
igrigorik commentedon Mar 11, 2015
Both of these should by addressed by Fetch API... @annevk have we made any progress on API to retrieve the Response object for a request initiated by a markup element?
annevk commentedon Mar 12, 2015
You mean as if it was made by an element? We don't really have that no. I think we should first have a way to populate such an element with a response and perhaps extract/modify its request. But all of those are kind of stalled lacking a good design...
igrigorik commentedon Mar 12, 2015
@annevk I guess, really, we need all three for element-initiated fetches:
As a starting point, where's the best place to open a bug for this?
annevk commentedon Mar 13, 2015
I think continuing in https://www.w3.org/Bugs/Public/show_bug.cgi?id=26533 would still be best. One problem is that several HTML elements now have quite complicated stories, doing multiple fetches and such.
igrigorik commentedon Apr 1, 2015
@getify do you mind pinging this bug with your use cases? The examples you gave are not specific to
preload, we should address them at a higher level.getify commentedon Apr 1, 2015
Actually, I think at least one perspective is related specifically to preload... in one respect, preload is kind of like a preflight request that resolves a URL from requested to final... so I'd like to be able to know that final URL for the follow-on main resource request, rather than re-using the original URL.
Of course, that has implications on whether it would still be possible for the system to do "matching" if you used initial URL for preload and final URL for main resource request..
igrigorik commentedon Apr 1, 2015
@getify you may not need to know that information, it depends on how we define 'matching'. If the matching is with respect to original request URL (which seems same, as otherwise we would catch a lot of developers off-guard), then you don't need to know the final URL or the headers. In fact, there are probably privacy / cross-origin restrictions that would prevent us from surfacing those bits anyhow.
igrigorik commentedon Jun 10, 2015
@getify are you familiar with the Fetch registry proposal? FWIW, I think that's the right mechanism and place to solve the use cases you've outlined - e.g. access to headers, get final URL, etc.
Closing this thread, let's continue the discussion on the w3 tracker. That said, feel free to reopen this if you feel otherwise.