July 9th 2010
RT @alanogden: hard work moving office today. All in and happy now!

July 9th 2010
obviously our previous tweet meant Friday 9th July :) Thanks to those who let us know!

July 7th 2010
Blog: Slackware, The love affair http://3dpixel.net/blog/slackware-the-love-affair/

July 6th 2010
we are moving to new office premises Friday 6th July. Moving up in the world (literally).

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.