Faster Page Loads with Apache mod_deflate output filtering
Apache 2.x is having module mod_deflate (mod_deflate.so) which can compress output irrespective of what scripting language you are using or even if you are serving a static but rich content website. If you are using PHP then there are ways available which can compress the output with buffering help but in that you need to write some code to make it happen but here we just need to enable mod_deflate module and add some configuration parameter and output compression will be taken care of by this module based on configuration provided.
To enable Apache > mod_deflate module, make sure you enable module by un-commenting it from httpd.conf file.
LoadModule deflate_module modules/mod_deflate.so
Then change <Directory ...> sections for Document Root in httpd.conf file as following:
You can change/alter above filters based on your requirement, means that if you don't need some specific file-types not to be compressed then you can remove those filters by just removing those lines from above list. Almost all file-types are added in above mentioned configuration but if anything else needs to be added then just add another line next to if with "AddOutputFilterByType DEFLATE <FILE_TYPE_INFO>".
After making this change restart Apache service and to see the immediate difference go to Information > Document Size option on your Firefox > Web Developer toolbar.
It will give detailed report of document assets/parts as seen in the next image with size after compression.