Jump to content
MDDHosting Forums

Speeding Up Page Load Time, Apache mod_deflate and cPanel "Website Optimizer"


Recommended Posts

Apache2 mod_deflate

We 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 KB

Gzipped Size: 4 KB

Data Savings: 69.23%

http://www.mddhosting.com/hosting.php with mod_deflate enabled via "Website Optimizer" from within cPanel.

Original Size: 28 KB

Gzipped Size: 4 KB

Data Savings: 85.71%

http://forums.mddhosting.com/ with mod_deflate enabled via "Website Optimizer" from within cPanel.

Original Size: 33 KB

Gzipped Size: 6 KB

Data 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" configuration

The 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.

  • Upvote 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 10 months later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...