Forum: NGINX gzip filter on streaming responses

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D7ae0b9a7a7dac25f83121ff45877be7?d=identicon&s=25 John Watson (Guest)
on 2012-10-15 23:33
(Received via mailing list)
I did some investigation and the gzip filter will only activate if there
is a Content-Length header with valid length.

Is there any way of deflating streaming responses from the nginx push
stream module? Where is there isn't a  known content length, but
potential for thousands of messages to be transferred?

Regards,

John
21a46ad06bed3b803d41cb2b8d6b1433?d=identicon&s=25 Justin Dorfman (Guest)
on 2012-10-15 23:58
(Received via mailing list)
Have you tried?

           gzip on;
           gzip_min_length 0;


Regards,

Justin Dorfman <http://www.twitter.com/jdorfman>

NetDNA <http://www.netdna.com>
The Science of Acceleration
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2012-10-16 12:41
(Received via mailing list)
Hello!

On Mon, Oct 15, 2012 at 02:32:44PM -0700, John Watson wrote:

> I did some investigation and the gzip filter will only activate if there
> is a Content-Length header with valid length.

This is not true.  With Content-Length present gzip filter is able
to more effectively allocate buffers (or skip responses as per
gzip_min_length), but it isn't limited to responses with
Content-Length present.

> Is there any way of deflating streaming responses from the nginx push
> stream module? Where is there isn't a  known content length, but
> potential for thousands of messages to be transferred?

As long as push stream module does things correctly it should
work, but that's the question more about (3rd party) push stream
module, not gzip filter.


--
Maxim Dounin
http://nginx.com/support.html
D7ae0b9a7a7dac25f83121ff45877be7?d=identicon&s=25 John Watson (Guest)
on 2012-10-16 20:54
(Received via mailing list)
That makes much more sense. Thank you for clarifying how the gzip filter
works.

There is a patch forthcoming for the push stream module that adds the
necessary information to get gzip working.

Regards,

John
This topic is locked and can not be replied to.