3 ms·
Afaik XHR allows you to access received data in a streaming fashion, but the XHR type will always buffer the full received payload internally. So if you try to
by Matthias247 8y ago
Afaik XHR allows you to access received data in a streaming fashion, but the XHR type will always buffer the full received payload internally. So if you try to stream a large amount of data over it you will eventually run out of memory. If you want to consume a potentially endless stream with custom encoding you need the fetch API with streaming support for that (https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams#Consuming_a_fetch_as_a_stream https://developer.mozilla.org/en-US/docs/Web/API/Streams_API...), as far as I understood. Or websockets.
That is one reason that e.g. gRPC streaming support doesn't work trivially in browsers.