-
Notifications
You must be signed in to change notification settings - Fork 31
Make preload headers work for fetches created by workers #115
Comments
@annevk Do you mean the fetch for a worker's script, or fetches created from within a worker? I'm not very familiar with how workers are defined, but from the title ("Documents only?") it sounds like it might imply that preload is limited to navigation requests. If that's what you meant, then per #92 I believe it's been established already to also apply to other fetches from a browsing context. That might mean workers are still not covered, though. Not sure :) |
Preloading "fetches created from within a worker". |
While it sounds like it should work, I wonder how useful it would be in practice. |
It seems that for module workers that might not necessarily be the case, but I'm not sure if cc @domenic |
For module workers I'd expect using modulepreload. |
One thing to consider here is that link headers work for subresources - e.g. a |
I'm not sure what you mean. A worker is roughly equivalent to a document as far as all kinds of things are concerned. (To be clear, I'm okay with not adding this feature as there might not be much need or demand for it.) |
I meant that perhaps when a worker has a link header, it should be loaded in the context of the owner document as if the worker was a subresource
|
I see. No that would not be appropriate. Note that workers might also be owned by other workers and some do not have an owner document at all (or do not have a stable owner document). @domenic for a worker to use |
I'm currently working on link headers here, but it doesn't yet specify link headers on subresources, only as part of navigation. I'd have to make the right check there to show that workers are not treated as "subresources" in that scenario. |
Fetch calls out workers as non-subresources (though they are not navigations either). Maybe we should have "environment request" as a concept, though thus far we haven't needed it concretely I think. |
Great, that definition would do for now. |
Discussion continues at whatwg/html#7889 |
Given the header it seems this should also work for workers. Would require a bit more abstracting in the prose.
The text was updated successfully, but these errors were encountered: