Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an nginx reverse proxy in front of my apache server.

How should I configure compression (gzip or deflate) to serve my website? Should it be from nginx or from mod_deflate from apache? My primary concern is performance and memory usage.

share|improve this question
    
pc-freak.net/blog/… –  Quintin Par Jun 4 '11 at 12:34
add comment

1 Answer

up vote 2 down vote accepted

Both represent the same compression algorithm with a different format (gzip adds checksums). There is a similar question with a couple of good answers here.

There is a web service testing compressed sites and showing the compression ratio if you are interested in this kind of data. Although the data is not going to be comparable among different pages - the compression ratio depends on the properties of input data.

Edit: additionally, the compression level is configurable - Apache has the DeflateCompressionLevel directive for configuring this.

Edit #2: Nginx has the gzip_comp_level directive for the same purpose (thanks Alaz)

And just in case it was not clear enough yet: given the same input data and the same compression level setting, you will see virtually the same compression ratio with both implementations (give or take a few bytes for the gzip checksums)

share|improve this answer
    
Nginx has gzip_comp_level to configure compression level as well. –  Alexander Azarov Jun 4 '11 at 7:58
    
My Q is on Nginx vs Apache. –  Quintin Par Jun 4 '11 at 8:38
    
...he said they're both based on the same algorithm, just formatted differently. He pointed you to different comparison questions and sites as well for reference. I think his answer is basically telling you that nginx and apache are both doing the same thing underneath when it comes to compression, so it doesn't matter much; it depends on the compressibility of the content you're serving. If they had different compression engines it might be different. –  Bart Silverstrim Jun 4 '11 at 10:23
1  
Nginx seems to be a choice to make not based on compression, but for it's specific performance and features in certain circumstances. See linuxjournal.com/magazine/… –  Bart Silverstrim Jun 4 '11 at 10:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.