# What could prevent gzip\_comp\_level from chaning?

**URL:** <https://www.ruby-forum.com/t/what-could-prevent-gzip-comp-level-from-chaning/184226>\
**Category:** NGINX\
**Created:** [February 26, 2010, 10:17pm UTC](https://www.ruby-forum.com/t/what-could-prevent-gzip-comp-level-from-chaning/184226 "2010-02-26T22:17:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgreiser](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/258eb7/32.png) [@tgreiser](https://www.ruby-forum.com/u/tgreiser)\
**Post date:** [February 26, 2010, 10:17pm UTC](https://www.ruby-forum.com/t/what-could-prevent-gzip-comp-level-from-chaning/184226/1 "2010-02-26T22:17:33Z")

</div>

Hi all,

According to yslow I seem to get the exact same size gzipped version of  
the page no matter what I set gzip\_comp\_level to. Does anyone know why  
that might be the case? This is for the page html (generated by  
mongrel) so not static content and I’ve checked a couple of different  
pages (some several hundred kb in size where I’d expect to see some  
difference) restarting nginx each time I changed the config file. I’ve  
included the output of nginx -V and the relevant portion of the nginx  
config below.

Thanks

http {  
…

# gzip settings - compression saves bandwidth, 256 \* 16 =\> 4mb max

compressed

# file size (actual max? seem like it streams through and still

compresses

# even when doesn’t fit as we used to have this much smaller and it

didn’t

# seem to prevent large pages from getting gzipped…)

gzip on;  
gzip\_min\_length 512;  
gzip\_buffers 256 16k;

# FIXME - good compression level? Tradeoff of servertime/serverload

vs.

# bandwidth/downloadtime

gzip\_comp\_level 6;  
gzip\_proxied any;

# note that text/html is always gzipped

gzip\_types text/plain text/css application/x-javascript  
application/xml+rss text/javascript;

# with gzip\_static on we can pre-compress our static files rather then

# recompressing them over and over again on the fly. All we need is

.gz

# versions of the files in the same locations with identical

timestamps.  
gzip\_static on;

# FIXME - I’m not sure if we should be setting these or not, for now

assume

# defaults are reasonable

#gzip\_http\_version  
#gzip\_vary

# Response Buffers - buffers requests from the servers to the client

# (freeing up the servers from slow clients). On by default but we

# reiterate for clarity.

# 1024 \* 16kb =\> 16mb max memory bufferable request response size.

proxy\_buffering on;  
proxy\_buffers 1024 16k;

# initial buffer size

proxy\_buffer\_size 8k;

# disable buffering to disk if response size exceeds proxy\_buffers (so

will

# stream from mongrel if memory size is exceeded), if non-zero this is

the

# max size that will be buffered to disk

# FIXME - we’ve made the memory cache size gigantic to compensate

(since we

# do still rarely serve very, very large pages).

proxy\_max\_temp\_file\_size 0;

$ nginx -V  
nginx version: nginx/0.7.65  
built by gcc 4.2.4 (Ubuntu 4.2.4-1ubuntu4)  
TLS SNI support disabled  
configure arguments: --prefix=/usr/local/pkg/nginx-0.7.65  
–with-md5=/usr/lib --http-log-path=/var/log/nginx/nginx\_access.log  
–error-log-path=/var/log/nginx/nginx\_error.log --with-http\_ssl\_module  
–with-http\_flv\_module --with-http\_sub\_module --user=www-data  
–group=www-data --pid-path=/var/run/nginx.pid  
–conf-path=/etc/nginx/nginx.conf --with-http\_gzip\_static\_module

$ sudo nginx -t  
the configuration file /etc/nginx/nginx.conf syntax is ok  
configuration file /etc/nginx/nginx.conf test is successful
