May 14th 2012
all servers are now upgraded to 1Gbit connections.

May 9th 2012
So your website has been hacked? #salvagemysite http://t.co/mOjhgegC

April 25th 2012
the cobalt platform is back up and running now.

April 25th 2012
we?re aware of an issue with cobalt. We?re investigating now.

You are here: Home » 3DPixelBlog

Apache Global Output Compression

Something we’ve been playing with for a while… global gzip / deflate compression on apache servers. Naturally you can do this in php or via .htaccess but why not do it globally from the apache configuration?

Decided to give it a whirl on some of our own dedicated servers the other day.

Dowsides:

  • Increases CPU load
  • Increases CPU load
  • Increases CPU load

Obviously there is only one major downside. The server has to compress the page on request and this takes processor power to do.

Upsides:

  • Reduces bandwidth
  • Increases client perceived responsiveness due to reduced page side

edit the main httpd.conf /etc/httpd/conf/httpd.conf for us:

#Alans gzip optimisations
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml

Obviously you need to have the mod_deflate DSO added to apache (default configurations from RedHat / CentOS have this). It’s also advatageous to note what you want compressing – it’s not worth compressing zip files for example or binary files as you are simply wasting CPU power.

Not Gzipped

Not Gzipped

Success! We’ve since enabled this on our shared platforms as we are not currently CPU limited.

Leave a Reply

You must be logged in to post a comment.