title: How do disable Transfer-Encoding in Tomcat 6
body: <p>I have a web application running on Tomcat 6.0.29 server and JDK 1.6.</p>
  
  <p>When I send the response to the client, Tomcat sends </p>
  
  <pre><code>Transfer-Encoding: chunked 
  </code></pre>
  
  <p>in the headers when the response size is > 8KB. For responses &lt; 8KB, it sends </p>
  
  <pre><code>Content-Length : 
  </code></pre>
  
  <p>I understand that <a href="http://en.wikipedia.org/wiki/Chunked_transfer_encoding">Chunked encoding</a> is the preferred way to handle bulk responses, however our clients do not want to change their code (as it is distributed all across the servers).</p>
  
  <p>How can I disable Chunked encoding in Tomcat? </p>
  
  <p>I could Disable HTTP/1.1 in Tomcat and enable HTTP/1.0 (not sure how I can do this)</p>
  
  <p>I tried the following with no success:</p>
  
  <ol>
  <li><p>In Connector tag in <code>server.xml</code>, I set <code>bufferSize =" 65536"</code></p>
  
  <pre><code>Connector port="8080" protocol="HTTP/1.1"
         connectionTimeout="20000"
         bufferSize="65536" socketBuffer="65536"
         redirectPort="8443" /&amp;gt;
  </code></pre></li>
  <li><p>Using NIOConnector in server.xml with following configuration:</p>
  
  <pre><code>&lt;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" /&gt;
  </code></pre></li>
  </ol>