Konstantin Kolinko wrote:
2011/1/14 Mark Thomas <[email protected]>:
On 13/01/2011 21:41, [email protected] wrote:
Does anybody know why Tomcat uses chunked encoding instead of content-length 
header (output buffering)?
Chunked encoding does not mean that the output is unbuffered. If a
client declares support for HTTP/1.1 then web servers are free to use
chunked encoding for the response if they choose.

I suspect what you are seeing is a side-effect of the fix for
http://issues.apache.org/bugzilla/show_bug.cgi?id=50496 but I haven't
checked through the code.


Confirming this issue. I added it to Bugzilla:
https://issues.apache.org/bugzilla/show_bug.cgi?id=50582


There have a been another couple of threads recently related to the chunked 
transfer-encoding.
If I remember correctly, in one of them the OP complained about Tomcat using this encoding for small responses, on the grounds of the added overhead or bandwidth introduced by the chunk headers. I am not sure that I agree with the basic principle (as the transfer-encoding is really the server's or intermediate agent's decision), but say in the interest of keeping the peace :

Suggestion: a new attribute of the Connector, allowing to set a minimum treshold for the start of chunked encoding, similar to the "compression" threshold. For example : minChunkTreshold="1000" would mean that below a 1000 bytes-size response, Tomcat does not use chunked encoding.

That is assuming that Tomcat /can/ detect that the response is "finished" after 
500 bytes e.g.



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to