Welcome! Log In Create A New Profile

Advanced

Re: Is it possible to send html HEAD early (chunked)?

Maxim Dounin
July 15, 2014 08:46AM
Hello!

On Mon, Jul 14, 2014 at 08:35:40PM +0200, Martin Grotzke wrote:

> Am 14.07.2014 14:54 schrieb "Maxim Dounin" <mdounin@mdounin.ru>:
> >
> > By default, nginx just sends what's already available. And for
> > SSI, it uses chunked encoding.
>
> I don't understand this. In my understanding SSI (the virtual include
> directive) goes downstream (e.g. gets some data from a backend) so that the
> backend defines how to respond to nginx. What does it mean that nginx uses
> chunked encoding?

The transfer encoding is something what happens on hop-by-hop
basis, and a backend can't define transfer encoding used between
nginx and the client.

The transfer encoding is selected by nginx as appropriate - if
Content-Length is know it will be identity (or rather no transfer
encoding at all), if it's not known (and the client uses HTTP/1.1) -
chunked will be used.

In case of SSI, content length isn't known in advance due to SSI
processing yet to happen, and hence chunked transfer encoding will
be used.

> > That is, if a html head is
> > immediately available in your case, it will be just sent to a
> > client.
>
> Does it matter if the html head is pulled into the page via SSI or not?

It doesn't matter.

> > There is a caveat though: the above might not happen due to
> > buffering in various places. Notably, this includes
> > postpone_output and gzip filter. To ensure buffering will not
> > happen you should either disable appropriate filters, or use
> > flushes. Latter is automatically done on each buffer sent when
> > using "proxy_buffering off" ("fastcgi_buffering off" and so on).
>
> Ok. Might this have a negative impact on my backend when there are slow
> clients? So that when a client consumes the response very slow my backend
> is kept "busy" (delivering the response as slow as the client consumes it)
> and cannot just hand off the data / response to nginx?

Yes, switching off proxy buffering may have negative effects on
some workloads and it is not generally recommended.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 08:50AM

Re: Is it possible to send html HEAD early (chunked)?

mex July 13, 2014 09:40AM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 11:36AM

Re: Is it possible to send html HEAD early (chunked)?

mex July 13, 2014 12:37PM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 02:54PM

Re: Is it possible to send html HEAD early (chunked)?

mex July 14, 2014 08:23AM

Re: Is it possible to send html HEAD early (chunked)?

Valentin V. Bartenev July 13, 2014 04:02PM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 13, 2014 06:28PM

Re: Is it possible to send html HEAD early (chunked)?

Maxim Dounin July 14, 2014 08:56AM

Re: Is it possible to send html HEAD early (chunked)?

Martin Grotzke July 14, 2014 02:36PM

Re: Is it possible to send html HEAD early (chunked)?

Maxim Dounin July 15, 2014 08:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready