-
Notifications
You must be signed in to change notification settings - Fork 31
Specifying or using preload twice #85
Comments
My intuition regarding those questions matches yours. I'm not sure if/how the "preload twice" scenario would work, nor do I think it's a major use-case. In general, I'm not aware of resource reuse rules being specified for preload or for other resource fetches.
is likely to result in two resource fetches (which may or may not be coalesced at the network layer), but I'm not aware of this being defined anywhere. I think we should define those rules and document the current state. The Fetch spec is probably where these definitions should be. |
As far as I know nothing allows for deduplication at the moment. |
If you preload a no-store image and then load it twice via two |
If someone could actually define preloading (and write tests) we'd no longer need to have these conversations. |
I agree this needs specifying, but this is not specific to link preload. e.g. |
That is specified actually. That's because HTML has image URL deduplication. (I forgot about that above, because it happens above the Fetch layer.) |
True, but the same is true for |
I think basically keeping HTTP cache semantics is good though I know the cache in Blink (blink::MemoryCache) in not conformant. Regarding fetch() / XHR, They're JS APIs and developers tend to want more consistent behavior for them than for img / css / etc, I think. I once got a request for XHR (https://crbug.com/333804) and the cache in Blink is now basically disabled for fetch() / XHR. |
Sorry for my ignorance, can you give me a link? I'm interested in how it's defined. |
@yoavweiss that might be an issue with Blink then. @yutakahirano https://html.spec.whatwg.org/multipage/embedded-content.html#the-list-of-available-images. |
@annevk I disagree it's an issue in Blink, but it seems there's divergence here. http://jsbin.com/bovagohehu/edit?html,console,output outputs a single download for Chrome, and 2 for Firefox. AFAIK, Safari would also issue a single download here (but hard to test, as ResourceTiming is not yet exposed). |
It's an issue in Blink because it violates the standard. If you want that kind of behavior you'd need to work on standardizing it. |
I don't disagree about the need for standardization, but not sure this behavior didn't precede current spec (this was the behavior in WebKit when I first started digging around that code in 2012) |
@annevk Thank you. |
This needs specifying as part of #97 |
Added a note in #97 to address this.. let's continue discussion there to consolidate threads. |
Hi, I have several questions regarding reusing preloads.
Assume "/resource" is served with "cache-control: no-store" header.
If my guesses for the questions are correct, what is the preferred way to preload twice? Is the following code fine?
cc: @yoavweiss, @annevk, @hiroshige-g
The text was updated successfully, but these errors were encountered: