【发布时间】:2011-09-12 01:38:31
【问题描述】:
我有一个在 Tomcat 6.0.29 服务器和 JDK 1.6 上运行的 Web 应用程序。
当我向客户端发送响应时,Tomcat 发送
Transfer-Encoding: chunked
当响应大小 > 8KB 时在标头中。对于小于 8KB 的响应,它会发送
Content-Length :
我知道Chunked encoding 是处理批量响应的首选方式,但是我们的客户不想更改他们的代码(因为它分布在所有服务器上)。
如何在 Tomcat 中禁用分块编码?
我可以在 Tomcat 中禁用 HTTP/1.1 并启用 HTTP/1.0(不知道该怎么做)
我尝试了以下但没有成功:
-
在
server.xml的连接器标签中,我设置了bufferSize =" 65536"Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" bufferSize="65536" socketBuffer="65536" redirectPort="8443" /> -
在 server.xml 中使用 NIOConnector,配置如下:
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" connectionTimeout="20000" socket.directBuffer="false" socket.rxBufSize="25188" socket.txBufSize="43800" socket.appReadBufSize="32768" socket.appWriteBufSize="32768" socket.bufferPool="500" socket.bufferPoolSize="100000000" socket.processorCache="500" socket.keyCache="500" socket.eventCache="500" socket.tcpNoDelay="false" socket.soKeepAlive="true" socket.soTimeout="5000" redirectPort="8443" />
【问题讨论】:
标签: http-headers tomcat6 chunked-encoding