⬆️ ⬇️

We study streams, chunks and look for the end.

Note: below is a translation of the article “On Streaming, Chunking, and Finding the End” , in which the authors consider the process of transferring information over an HTTP connection and the possibilities for speeding up this process. My comments further in italics.



Two ways to transfer





As with most data transfer mechanisms, in HTTP there are two main ways to send a message: “all at once” or “in parts”. In other words, in HTTP it is possible to send data as long as there is at least something that can be sent, or send all data as one logical unit, specifying its size in advance.

')

If you have been doing web development for quite a long time, chances are, you already know how flush buffer works on the server side. This method allows you to start sending part of the data to the user, while the script can continue to perform some rather slow actions (say, a resource-intensive database query). If you have already used this feature, then you probably took advantage of the streaming mechanism, although you might not know all the details of the HTTP protocol.



read further on webo.in →

Source: https://habr.com/ru/post/31537/



All Articles