Welcome! Log In Create A New Profile

Advanced

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

Maxim Dounin
July 14, 2014 08:56AM
Hello!

On Sun, Jul 13, 2014 at 02:49:18PM +0200, Martin Grotzke wrote:

> Hi all,
>
> inspired by the bigpipe pattern I'm wondering if it's possible to send the
> full html head so that the browser can start downloading CSS and javascript
> files.
>
> An idea would be that the proxied backend uses a chunked encoding and sends
> the html head as first chunk. The body would be sent as a separate chunk as
> soon as all data is collected.
>
> Not sure if this is relevant: In our particular case we're using ssi in the
> body to assemble the whole page, and some of the includes might take some
> time to be loaded. The html head contains an include as well, but this
> should always be loaded from the cache or should be served really fast by
> the backend.
>
> What do you think about this? Has anybody tried this already?

By default, nginx just sends what's already available. And for
SSI, it uses chunked encoding. That is, if a html head is
immediately available in your case, it will be just sent to a
client.

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).
Flush can be also done explicitly via $r->flush() when when using
the embedded perl module.

--
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: 87
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