Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个位于 IIS7 上的 ASP.NET 3.5 网站。我正在使用动态压缩,想看看是否可以启用分块编码。IIS 或 Web 配置上是否有一些设置可以启用它?
根据我的经验,调用 Response.Flush() 会将 Transfer-Encoding 设置为分块。实际上,我认为设置 Response.BufferedOutput 会在每次刷新 Response.OutputStream 时将其设置为分块。
也就是说,除非设置了 Content-Length,否则它只会刷新输出而不设置分块。
如果您编辑 IIS 配置,您可以设置<asp enableChunkedEncoding />元素/属性来设置它。
<asp enableChunkedEncoding />