Chunked transfer encoding - browser behavior

前端 未结 3 1888
庸人自扰
庸人自扰 2020-11-29 05:26

I\'m trying to send data in chunked mode. All headers are set properly and data is encoded accordingly. Browsers recognize my response as a chunked one, accepting headers an

3条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 05:59

    The browser can process and render the data as it comes in whether data is sent chunked or not. Whether a browser renders the response data is going to be a function of the data structure and what kind of buffering it employs. e.g. Before the browser can render an image, it needs to have the document (or enough of the document), the style sheet, etc.

    Chunking is mostly useful when the length of a resource is unknown at the time the resource response is generated (a "Content-Length" can't be included in the response headers) and the server doesn't want to close the connection after the resource is transferred.

提交回复
热议问题