How to display HTML to the browser incrementally over a long period of time?

前端 未结 8 746
生来不讨喜
生来不讨喜 2020-12-05 11:58

Do I need to pass back any HTTP headers to tell the browser that my server won\'t be immediately closing the connection and to display as the HTML is received? Is there anyt

8条回答
  •  伪装坚强ぢ
    2020-12-05 12:10

    The client will close the connection when it does not receive any data for a certain time. This timeout cannot be influenced by HTTP headers. It is client-specific and usually set to 120 seconds IIRC.

    So all you have to do is send small amounts of data regularly to avoid hitting the timeout.

提交回复
热议问题