Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.
This repository was archived by the owner on May 5, 2022. It is now read-only.

Final URL/headers after redirects? #14

Closed

Description

@getify

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.

Activity

  1. igrigorik commented on Mar 11, 2015

    @igrigorik
    Member

    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?

  2. annevk commented on Mar 12, 2015

    @annevk
    Member

    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...

  3. igrigorik commented on Mar 12, 2015

    @igrigorik
    Member

    @annevk I guess, really, we need all three for element-initiated fetches:

    1. Mechanism to modify the fetch initialization options
    2. Mechanism to extract the response object (to inspect its properties and response itself)
    3. Mechanism to modify/populate the response

    As a starting point, where's the best place to open a bug for this?

  4. annevk commented on Mar 13, 2015

    @annevk
    Member

    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.

  5. igrigorik commented on Apr 1, 2015

    @igrigorik
    Member

    @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.

  6. getify commented on Apr 1, 2015

    @getify
    Author

    The examples you gave are not specific to preload

    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..

  7. igrigorik commented on Apr 1, 2015

    @igrigorik
    Member

    @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.

  8. igrigorik commented on Jun 10, 2015

    @igrigorik
    Member

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions