News for hackers. Stuff that matters.
Re:HTTP/3: from root to tip by Matthias247 on Sunday January 27, 2019 @05:46PM (#19014233)
You can use server-sent-events or use do some custom streaming format inside the response body. The latter might not work well, due to the fact that arbitrary streaming APIs might not yet be exposed by all browsers (ReadableStream on fetch API: https://caniuse.com/#feat=streams).
Re:HTTP/3: from root to tip by cryptonector on Sunday January 27, 2019 @06:10PM (#19014344)
I thought all XHRs support streaming, and they should run over HTTP/{2,3}. Is that not right?
Re:HTTP/3: from root to tip by Matthias247 on Sunday January 27, 2019 @08:58PM (#19014948)
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...), as far as I understood. Or websockets.

That is one reason that e.g. gRPC streaming support doesn't work trivially in browsers.