I'm extending this previous question: Aborting a HTTP/1.1 chunk encoded response
When I abort a chunked response Chrome displays a blank page and the dev console reports net::ERR_INCOMPLETE_CHUNKED_ENCODING. IE displays the incomplete page. Is there a way to send the user to an actual 500 error page?
Can I output something that corrupts the document so the browser won't use it? If so, what's the shortest string I can send to achieve this?
Unfortunately, there is no chunk you can send that says to the browser "Hey, forget everything I sent so far - something went wrong". Sending a TCP reset packet will cause most browsers to display a "Server reset connection" page, but that requires access to one level down the network stack.
The only other I can think of is to try sending a chunk with a negative length. I don't know how browsers react to that.