问题
I have an ASP.NET 3.5 website residing on IIS7. I am using dynamic compression and wanted to see if I can enable chunked encoding. Is there some setting on IIS or web config that enables it?
回答1:
In my experience, calling Response.Flush() will set the Transfer-Encoding to chunked. And actually I think setting Response.BufferedOutput will set it to chunked everytime Response.OutputStream is flushed.
That is unless a Content-Length has been set, then it just flushes the output without setting chunked.
回答2:
If you edit the IIS configuration you can set the <asp enableChunkedEncoding />
element / attribute to set this.
来源:https://stackoverflow.com/questions/2277704/enable-chunked-transfer-encoding-in-asp-net