actually I am reading Steve Souders book "High Performance Websites". He is describing with 14 rules how you can increase the performance of any website. I also saw him live talking @jsconfeu what was really cool ;-) (thanks Steve!).
Creating a bigger project like we do with eUNIQUE is kind of a challenge and fun. But seeing it growing and adding a lot of functionality, requires also a lot of maintenance concerning a good usability behavior. The behavior is often defined (or even mostly) in how fast a page is loading.
Coming back to Steve Souders and his book, leads to one of the biggest most important rules in achieving a good performance of your website: output compression. This will reduce response times up to 75% - 90%. Wow - awesome! So when trying to set this up in apache2, I was running in some problems.
In apache2, the module which needs to be enabled is called mod_deflate. For a deeper understanding and further configuration options I recommend reading the docu in depth. To check if the module is enabled you simply fire up this command:
# a2enmod deflate Module deflate already enabled
If you see the result shown above, everything is fine. Otherwise enable it first.
Then I was not sure which configuration is need exactly. So here is the most simple way to get compression running, you need the following lines:
Finally the question was, where to put the directives. If you want to compress all these files for all VirtualHosts you have running, simply put it into your apache2.conf (/etc/apache/apache2.conf). If you want to keep this a little more fine granulated, put it into your VirtualHost container. It doesn’t matter where you put it there. Although, a good place would be the
For testing purposes, I am using YSlow as a Firefox Extension. After setting up the directive’s in apache and doing a graceful reload … nothing happened. WTF? After playing around for a while I recognized, that I had to clean the Firefox cache and had to stop and start the apache webserver. Doing so, I could see the positive result (getting a A grade for compressing text files ;-) ) in YSlow. Chakka!
I think this is a really easy way to increaes the page loading time for your website or project. I strongly encourage you to use it and set it up. Actually I am not sure if you could also use the directives in a .htacces file. Check it out!