We're using ASPX + Portal mode, unfortunately that post was not helpful. I did try creating an HTTPHandler but had no luck manually adding the Content-Length header.
The Transfer-Encoding: chunked header was causing problems with our IIS Proxy server once the page size grew to over 256K, which happens to be the default limit of cache buffer size on IIS when you use Application Request Routing. To fix this on the proxy we changed that buffer size to 1024K and our problem went away.