I am migrating an application for a customer to Tomcat 6. During testing we discovered that some of their clients expect the response to always be chunked, i.e. Transfer-encoding: chunked. However, Tomcat does not always use chunked encoding and sometimes uses Content-Length instead, I assume because the response size is small enough that it knew the whole length when the headers were being sent.
I have seen tons of questions/answers about how to disable chunked encoding but I have the opposite problem. I know that it is not ideal to force chunked encoding in every response and that the client should be fully compatible with the http1.1 spec and accept either encoding, but I'm just trying to find out if there is any easy configuration I can do to enable the desired behavior.
I am using Tomcat alone and the standard http connector. I've looked at the connector attributes and played around with bufferSize and socketBuffer with no luck.
Is there anything I can do to force chunked responses?