-
Notifications
You must be signed in to change notification settings - Fork 24
Processing model for as
?
#66
Comments
My proposal is that we drop
|
Highly related: /cc @annevk |
Let me revive this thread a bit, but I can file a new issue if that's better. In a double-keyed cache world resources fetched for the current origin may not be reused in the next navigation if it crosses origins, and therefore prefetching subresources may not make a lot sense, unless they are made for the current navigation. On the other hand main resource for top-level navigation seems to be able be safely prefetched and cached for the next navigation as the origin of resource == the origin of the navigation that is used. However this can work only if we have as= or something that specifies how / when the prefetched resource is used. If this sounds valid should we close this issue and keep as=? Alternative proposal could be to limit prefetch only to be usable for top-level navigations, as prefetching subresources may not work in anyways in double-keyed cache world. Could it make sense or is it too limiting? |
I would argue the browser should be responsible for prefetching anything inside a |
/cc @noamr |
w3c/webappsec-csp#542 is my suggestion on how to handle this. |
Is there a use-case for |
I believe that having Besides those (minor?) use-cases, the main use case is ergonomic - to align prefetch and preload, and to provide good defaults when certain attributes are not necessary. In any case, the other proposal also handles CSP for prefetch etc., it's not only about allowing as-less preloads. |
I suspect Chromium implementation wouldn't be able to reuse |
Maybe the same as prefetch but with a high fetching priority. |
What's the use case for that? |
When you're not sure exactly how your resource is going to be used, some resource types can be used in multiple ways. Not sure this is a strong use-case, what I'm trying to do here is align prefetch and preload to make more sense and be in alignment with each other. |
OK, I think I understand the consistency argument. Once we allow preloads without |
If this has use cases, I feel this still should be As for consistency, I feel the differences in |
Sure, I can get behind this. |
|
as
for prefetch is not currently implemented in any browser AFAIK.Its definition in the spec is somewhat problematic. It is described as optional, yet it's not clear what its processing should be:
as
must passconnect-src
policy and could only be reused by XHR and Fetch (assuming streaming issue is fixed. I'm not yet sure if it's a spec issue or an implementation one)as
is not processed (other than perhaps forAccept
headers), and we diverge from preload in its definition.If we'd take the above route, treating
as
as optional will break backward compatibility with existing content out there.If we don't, we would break consistency with preload, and surprise developers.
P.S. examples include
as=html
which is not a valid destination. Should bedocument
? If so, how can we tell apart top-level navigation from an iframe?The text was updated successfully, but these errors were encountered: