2

Let us assume, we are generating a web page with PHP on apache and we want the browser to display the page progressively while the script still runs. We can do this by (possibly adding some padding and) calling flush(), which generates chunks using Transfer-Encoding: chunked;.

Now if an error occurs during the processing, in order to indicate this to the user, we need to abort the connection. So:

How can we close the http connection without sending the final empty chunk?

Alternatives, which we do not want to consider are

  • using JavaScript to display the error
  • using HTTP trailers
Community
  • 1
  • 1
bodo
  • 1,005
  • 15
  • 31

0 Answers0