Re: [whatwg/xhr] Clarify allowed behavior when response is "too big" to "fit" in memory/on disk? (#244)

> The `img` element has `progress` events in its specification. 

That's what I get for trusting stack overflow rather than reading the actual spec... Yeah, in that case that seems like it would pretty much be the same situation.

> Depending on how smart you are about it you could also terminate certain `fetch()`es earlier I suppose. Or a `blob()` invocation on a clone while letting the streaming variant continue... Hmm, not sure we should go there. 😊

Yep... lots of "opportunity" for "optimizations". As currently written the various specs mostly seem to imply that an implementation should always fetch all the bytes, and if the spec says anything about browser resources allowing failure (like for XHR to ArrayBuffer), such failure can only happen after all the bytes are read. It is of course possible to implement that (just throw away the bytes as we're fetching them, but don't report an error until the whole thing is fetched), but I doubt any implementation does that today. Of course what happens when you exhaust system resources isn't really very well specified anywhere, so not sure how important this is, except that apparently websites are relying on certain behavior for operations that would have exhausted resources had the websites not canceled the operation before it got to that point...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/xhr/issues/244#issuecomment-483756211

Received on Tuesday, 16 April 2019 16:52:51 UTC