Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 78367 invoked from network); 12 Jun 2009 13:30:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 13:30:08 -0000 Received: (qmail 63671 invoked by uid 500); 12 Jun 2009 13:30:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 63601 invoked by uid 500); 12 Jun 2009 13:30:16 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 63590 invoked by uid 99); 12 Jun 2009 13:30:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 13:30:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [88.198.36.7] (HELO mail2.ddt-consult.de) (88.198.36.7) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 13:30:04 +0000 Received: from localhost (localhost [127.0.0.1]) by mail2.ddt-consult.de (Postfix) with ESMTP id 95AC1400248 for ; Fri, 12 Jun 2009 15:29:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail Received: from mail2.ddt-consult.de ([127.0.0.1]) by localhost (mail2.ddt-consult.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id J9yyNVW4G581 for ; Fri, 12 Jun 2009 15:29:43 +0200 (CEST) Received: from [192.168.42.106] (p57911D5E.dip.t-dialin.net [87.145.29.94]) (Authenticated sender: mks@list-post.mks-mail.de) by mail2.ddt-consult.de (Postfix) with ESMTPSA id A7D6B400222 for ; Fri, 12 Jun 2009 15:29:43 +0200 (CEST) Message-ID: <4A325847.5070408@list-post.mks-mail.de> Date: Fri, 12 Jun 2009 15:29:43 +0200 From: =?UTF-8?B?TWFya3VzIFNjaMO2bmhhYmVy?= Reply-To: users@tomcat.apache.org User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.21) Gecko/20090409 Thunderbird/2.0.0.21 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: chunked encoding References: <40D5E3C3CBE03D45A776E7C358BDE9080127DD58@missoula.formatdynamics.com> <4A31597A.6030508@list-post.mks-mail.de> <40D5E3C3CBE03D45A776E7C358BDE9080127DD7F@missoula.formatdynamics.com> <4A317D8D.3060107@ice-sa.com> <40D5E3C3CBE03D45A776E7C358BDE9080127DDA6@missoula.formatdynamics.com> <4A32153A.5090401@list-post.mks-mail.de> <4A322370.8060607@kippdata.de> <4A3240D1.8050003@list-post.mks-mail.de> <4A324F35.4050909@ice-sa.com> In-Reply-To: <4A324F35.4050909@ice-sa.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org André Warnier: > In summary thus : > > - making the request be HTTP 1.0, no matter how it's done, is not going > to magically make Tomcat send the response in one chunk nor add a > Content-Length header. Exactly. > (it may just /prevent/ it from adding a "Content-transfer-encoding: > chunked" header, yes ?) It may prevent it from sending chunked content (and adding the appropriate header) in 100% of the cases, since there's no chunked transfer encoding in HTTP/1.0. IOW, you may replace "may" with "will" in the above sentence ;-). > - the first-choice solution would be to have the CDN fix their software, > or select another CDN which can handle chunked content. I agree. > - the second-best would be : > (presuming the OP knows at some point the real size of the data chunk > that has to be sent back.) > Write a servlet which obtains the data, then uses > response.setContentLength(nnn), then does a > response.getWriter/getOutputStream, then writes the data there. Yes ? > > - if the above is not acceptable/practical, then another solution would > be to intercept and buffer the full response somewhere, calculate its > size, and then forward it unchunked, preceded by a proper Content-Length > header. Yes. I just noticed that the OP said he was going to experiment with setting the bufferSize attribute of the AJP Connector to a higher value. That might indeed be the easiest workaround - provided the output his servlets/JSPs generate do not exceed the buffer size - and this attribute really does what I understand it does. Using ServletResponse#setBufferSize, which I already mentioned, might work too - on an per servlet level. But if increasing the value of the bufferSize attribute of the Connector works, it's much less hassle. -- Regards mks --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org