2011/1/14 André Warnier <a...@ice-sa.com>: > Konstantin Kolinko wrote: >> >> 2011/1/14 Mark Thomas <ma...@apache.org>: >>> >>> On 13/01/2011 21:41, verlag.preis...@t-online.de 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. >
There is already, - buffer size, 8Kb. The question is why this feature does not work in this particular case -- see the issue in Bugzilla. Chunked encoding is used when content length is not known when response headers are being sent out. The question is what triggers sending the headers and why the response length is not known at that time. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org