Re: [whatwg/fetch] Allow request/response.blob() to resolve before reading the full stream (#556)

Apologies for the confusion.  I oversimplified and oversold the awesome powers of Blobs in that issue.  Gecko only ever hands out Blob instances when the entire contents are available.  There are currently no plans to speculatively return Blobs before all the data is received.  Having said that, there is the edge-case https://github.com/w3c/FileAPI/issues/47 wherein Gecko will throw an error on reads if the backing file selected from `input[type=file]` has had its file size change since selection.

Clarifying Gecko optimizations: As @wanderview points out, Gecko's Blob optimizations do not currently apply to Response.blob().  Its implementation is naive and treats all responses like they came over the network, consuming them in their entirety.  Its returned Blob will be file-backed if it was large enough to spill to disk (and privacy/security settings allow), but it will be a new file on disk that is distinct from the one stored by the Cache API.  Having said that, we're not far from being able to implement such an optimization, but it definitely will not return the Blob until the response has been received in its entirety (making them fully-written "incumbent records" instead of in-progress "fetching records").

-- 
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/fetch/issues/556#issuecomment-309928295

Received on Wednesday, 21 June 2017 00:27:08 UTC