Welcome! Log In Create A New Profile

Advanced

Re: Gzip not compressing response body with status code other than 200, 403, 404

Maxim Dounin
August 31, 2012 08:54PM
Hello!

On Sat, Aug 25, 2012 at 02:32:02AM -0400, soniclee wrote:

> I met same problem while try to gzip response with other status code. Any
> update for this issue?

In some cases it's just not possible to compress
response, e.g. you can't compress 206 as it doesn't contain full
entity body. Or you can't compress 304 as it has no entity at
all.

In many cases it's unwise/unsafe to compress responses with some
status codes. I.e. you probably don't want to compress 400 (Bad
Request) response even if client claimed gzip support before it
did some syntax error in the request - as you already know client
did something wrong, and it's better to return easy to understand
response. Or e.g. if you try to return 500 (Internal Server
Error) due to memory allocation error - you probably don't want to
allocate memory for gzip.

Due to the above reasons gzip compression is done only for certain
common and safe response codes. And from the above explanation it
should be more or less obvious that it just can't be enabled for
all status codes.

If you think gzip compression should be enabled for some specific
status code - please provide your suggestions with reasoning.

Maxim Dounin

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

Gzip not compressing response body with status code other than 200, 403, 404

Tony Tsang June 03, 2011 06:18AM

Re: Gzip not compressing response body with status code other than 200, 403, 404

soniclee August 25, 2012 02:32AM

Re: Gzip not compressing response body with status code other than 200, 403, 404

Maxim Dounin August 31, 2012 08:54PM

Re: Gzip not compressing response body with status code other than 200, 403, 404

Bruno Prémont March 03, 2013 10:10AM

Re: Gzip not compressing response body with status code other than 200, 403, 404

Maxim Dounin March 04, 2013 07:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready