| Issue 652228 | Requests with useStreamOnResponse flag don't reuse preloaded resources | |||||||||||||
| Starred by 11 users | Project Member Reported by y...@yoav.ws, Oct 3 | Back to list | ||||||||||||
Version: M55 OS: Mac (but probably all) What steps will reproduce the problem? (1) http://paulirish.github.io/web-feature-availability/ (2) Look at downloaded resources What is the expected output? data.json should be downloaded once What do you see instead? It is downloaded twice. Looking into why, it seems that this resource is loaded via `fetch()`, which turns on the useStreamOnResponse flag, which means that `ResourceFetcher::determineRevalidationPolicy()` says it needs to be reloaded. Trying to naively remove that restriction results in assertion failures. We need to figure out a way to preload `fetch()` based resources without triggering double downloads (otherwise, `fetch()` would be significantly slower than the equivalent XHR).
Comment 1
by
y...@yoav.ws,
Oct 3
,
Oct 6
,
Oct 7
Loading triager here. Removing from loading as this seems like a fetch issue.
,
Nov 13
http://output.jsbin.com/kuqirix/quiet reduced demo
,
Nov 13
Seems like XHR has the same issue http://output.jsbin.com/kusapoq/quiet
,
Nov 14
,
Nov 15
XHR is a slightly different issue, and fwiw, I'm able to reuse XHRs when they don't have a `crossorigin` attribute and their withCredentials flag is set to true. Not sure that's the correct behavior, tbh.
,
Nov 15
,
Nov 22
Adding XHR component since this is also an issue there.
,
Dec 14
,
Dec 14
,
Dec 19
Talked w/yoav. He is making efforts to resolve this issue. Thanks!
,
Dec 23
Dug around the code a bit and I'd need some guidance from fetch()/streaming folks in order to proceed. Current situation is that if we do match fetch() requests with previously preloaded resources, we get a response with a nullptr WebDataConsumerHandle in FetchManager::Loader::didReceiveResponse() (which ASSERTS) If I ignore that assert, it seems like the handle is required to create BytesConsumerForDataConsumerHandle which is required for BodyStreamBuffer which is in turn required for FetchResponseData::createWithBuffer(). The source of the nullptr handle is RawResource::didAddClient() which called client->responseReceived() with a nullptr handle. I don't think there's a way to create a handle there, as the current handle implementation in created in content/. I'm also not sure such a thing would make sense. So, one possible way to fix this would be to create a BytesConsumer that doesn't require a WebDataConsumerHandle, and let it handle situations where the handle is nullptr. Does that make sense? Would that actually work?
,
Jan 9
,
Jan 9
yhirano@ - friendly ping :) Thoughts on the proposed way to tackle this?
,
Jan 31
Another friendly ping. For context, the new code review system Chromium is switching to within a few months would benefit *highly* (on the order of seconds) from this and issue 678429 by preloading fetch requests to the API.
,
Feb 7
We talked about this topic recently and I would like to sort things (MemoryCache, RawResource[Client], ThreadableLoader[Client], etc) out to fix this issue.
,
Feb 7
Awesome. Thanks for the update, Yoav!
,
Feb 7
Oops. I meant yhirano. 😑
,
Mar 21
Issue 702727 has been merged into this issue.
,
Mar 21
(6 days ago)
|
||||||||||||||
| ► Sign in to add a comment | ||||||||||||||