答复: How to disable chunked transfer-encoding

Maxim Dounin mdounin at mdounin.ru
Thu Jun 4 22:49:18 MSD 2009


Hello!

On Fri, Jun 05, 2009 at 02:11:11AM +0800, Zhang,Tony wrote:

> Hi
> 
> Oh, gotcha , I did enable gzip
> 
> So, for instance, If I put a squid in front of Nginx which is gzip enabled, the chunked header will be disappeared, correct?

As long as squid will behave like proxy (i.e. any uncached 
request) - no, it shouldn't (as squid has to read full response 
before it will be able to drop chunked encoding).

> And my question is , will the chunked header do performance impact on static content serving, that's my concern, and considering adding squid like things in front of Nginx?

No, shouldn't have any noticeble performance impact, it's just a 
few extra bytes.  Adding squid in from of nginx will likely have 
though - I guess it will slow down things a lot.

If you really care about performance - take a look at gzip_static 
module instead.  This will save you a lot of CPU time.  As a side 
effect it will allow nginx to use Content-Length instead of 
chunked, but this doesn't really matter.

Maxim Dounin


> 
> 
> Thx
> Jie
> 
> -----邮件原件-----
> 发件人: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] 代表 Maxim Dounin
> 发送时间: 2009年6月5日 0:58
> 收件人: nginx at sysoev.ru
> 主题: Re: How to disable chunked transfer-encoding
> 
> Hello!
> 
> On Fri, Jun 05, 2009 at 12:23:54AM +0800, Zhang,Tony wrote:
> 
> > Hi
> >
> > I found that Nginx set chunked transfer-encoding as default, so how can I disable this transfer-encoding, because I am serving static content. And by the way, is it a little bit harmful to use chunked transfer encoding on serving static content?
> 
> Support for chunked encoding is required for HTTP/1.1 clients,
> and nginx doesn't use it for HTTP/1.0 clients (as required by RFC
> 2616 too), so it should be safe.
> 
> But the question is - why chunked used in your case.  It's not
> used by nginx for static content with known length.  Possible
> reasons include SSI processing truned on and/or gzip enabled
> (since resulting length of the response isn't known while sending
> headers, and chunked transfer encoding is the only way to keep
> connections alive in this case).
> 
> Maxim Dounin
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.339 / Virus Database: 270.12.53/2154 - Release Date: 06/04/09 05:53:00
> 
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.339 / Virus Database: 270.12.53/2154 - Release Date: 06/04/09 05:53:00
> 
> This e-mail is confidential. It may also be legally privileged.If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error,please delete it and all copies from your system and notify the sender immediately by return e-mail.Internet communications cannot be guaranteed to be timely,secure, error or virus-free. The sender does not accept liability for any errors or omissions.





More information about the nginx mailing list