For website developers or webmasters, there is a quick and simple way to speed up the loading of your website. Those using Joomla CMS websites will notice a serious increase in performance, but even a standard HTML/CSS website can notice a 45% reduction in the landing page's required download size. You better get GZip enabled.
These improvements can be used on regular HTML websites as well. So for those looking to improve website speed load times as well as decrease bandwidth on your server, just add these lines to your .htaccess inside of the root directory. I have personally tested this on several websites. It doesn't have to be inserted anywhere in particular so it can simply be inserted at the bottom of the file. I have tried so many other configurations to no avail, and this one is by far the simplest to implement.
The "if" statement is merely to determine if the server has the mod_deflate enabled or not. If you are unsure, definitely leave the "if" statement intact, otherwise the lines can be removed. You may add other lines of code to include or exclude certain types of files. Please search the internet for those. You can always check PageSpeed to see if it is now seeing that you have correctly enabled Gzip.
Some important notes: GZip is a resource intensive service. Massive website with large amounts of traffic can see detrimental effects if using GZip and PHP websites especially on shared servers. Most users will never see the amount of traffic needed to create problem and to remedy the situation you could (and should already) be using cached pages.
We try to give credit where credit is due. This information was originally found at Sal's Code as I was building this website.