Michael D. Posted November 4, 2008 Report Share Posted November 4, 2008 Apache2 mod_deflateWe have recently enabled mod_deflate on our servers which enables the possibility to have Apache compress the files that it serves to your visitors before transmitting them resulting in lower bandwidth usage and quicker load times. We have enabled this on MDDHosting.com and although the difference is not major for an individual page load when you compare thousands of visitors hitting one page the difference can be incredible. http://www.mddhosting.com/ with mod_deflate enabled via "Website Optimizer" from within cPanel.Original Size: 13 KBGzipped Size: 4 KBData Savings: 69.23%http://www.mddhosting.com/hosting.php with mod_deflate enabled via "Website Optimizer" from within cPanel.Original Size: 28 KBGzipped Size: 4 KBData Savings: 85.71%http://forums.mddhosting.com/ with mod_deflate enabled via "Website Optimizer" from within cPanel.Original Size: 33 KBGzipped Size: 6 KBData Savings: 81.82%As you can imagine when you are transferring much less data the transfer takes less time and pages load faster for the end user. The results from the above tests were obtained via a very useful tool for testing whether mod_deflate or mod_gzip is working as it should and it also gives you the above results to give you an approximation of how much bandwidth you are actually saving. The tool can be found at:http://www.whatsmyip.org/mod_gzip_test/ cPanel "Website Optimizer" configurationThe default setting when you enable mod_deflate using the website optimizer is "text/html text/plain text/xml" however we have opted to use "text/html text/plain text/xml text/css text/js" so that our CSS Style sheets as well as our JavaScript files are also compressed for transfer. We do not recommend enabling anything beyond what we are using unless you are experienced with mime types and familiar with which types can and cannot be compressed. As an example if you opt to compress Adobe .PDF files they will become unreadable for the end user however the files on the server will not be damaged and the setting can be reversed. 1 Quote Link to comment Share on other sites More sharing options...
bunnykins Posted November 4, 2008 Report Share Posted November 4, 2008 Like gzip being enabled does some thing like this result in a higher cpu load? Quote Link to comment Share on other sites More sharing options...
Michael D. Posted November 4, 2008 Author Report Share Posted November 4, 2008 Like gzip being enabled does some thing like this result in a higher cpu load?It does increase the CPU time required to process the page but in plain text files such as html the difference is minimal. We don't overload our servers (I'd go so far as to say they're quite unloaded) so the extra CPU time is no issue whatsoever. The next question is that if it takes more CPU time to process doesn't that mean it takes longer to send the page? The answer is technically yes, it may take a couple of milliseconds longer to process the page but the file size is generally reduced by 50~85% resulting in a much faster transfer that greatly outweighs the increased processing time. Quote Link to comment Share on other sites More sharing options...
bunnykins Posted November 5, 2008 Report Share Posted November 5, 2008 Thanks and it sounds good. Quote Link to comment Share on other sites More sharing options...
Blind Bandit Posted November 5, 2008 Report Share Posted November 5, 2008 Will this effect what is sent or will it mess with formatting at all? I'm just curious if it will for instance cause issues with layout or various other parameters. Quote Link to comment Share on other sites More sharing options...
Michael D. Posted November 5, 2008 Author Report Share Posted November 5, 2008 Will this effect what is sent or will it mess with formatting at all? I'm just curious if it will for instance cause issues with layout or various other parameters.The server compresses the content before it's sent, then the browser decompresses it. You can look at it similarly as if you are downloading a 100megabyte program unzipped or a 100megabyte program that has been zipped down to 45megabytes. In the end you get the same result but the zipped file transfers much more quickly. If the browser the end user is using does not support mod_deflate/mod_gzip then regular uncompressed content is sent. The browser has to specifically request compressed content for the server to send it. Quote Link to comment Share on other sites More sharing options...
Michael D. Posted September 16, 2009 Author Report Share Posted September 16, 2009 It should also be noted that if you are hosted on a LiteSpeed server (as all MDDHosting Customers are) that GZIP Compression is handled automatically and seamlessly to help reduce your bandwidth usage. There's no need to go into the cPanel to change any settings Quote Link to comment Share on other sites More sharing options...
sremick Posted September 29, 2009 Report Share Posted September 29, 2009 So this is already automatically enabled then? Quote Link to comment Share on other sites More sharing options...
Michael D. Posted September 29, 2009 Author Report Share Posted September 29, 2009 So this is already automatically enabled then?Yes, unless the browser doesn't support it - the browser has to request gzipped content to be sent gzipped content. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.