This is something that I add to all my sites, it will increase the load time. Check your site now on http://gtmetrix.com/. < This site gives you a breakdown of your sites performance and will show you the areas that you need to improve on. This page is dedicated to improving your sites performance, which in turn keeps readers happy. This is why this snippet is part of my must have snips. It increased my sites performance by about 6%.
Add this above everything in the header.php of your theme, add it right at the very top of your document. What this does is a little bit of magic, it determines what type of content encoding the browser will accept (“gzip”, “deflate” or none at all) and will return its output accordingly.
<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
After you check again with gtmetrix.
You’re aiming for all green bars really, anything that is red should be sorted out pretty quickly. Hopefully now you should see a change in your performance.
There are still some other things you can do to help with the performance…
Setting the header expires on files and images in your .htaccess file.
You’ll need to access your web host to do this, but that really is simple.
Basically you have two choices; You can do this with an FTP client or through your websites cPanel, you would have been given your login details for the cpanel and ftp when you registered with your web host, so check your emails for those.
To access the cpanel add /cpanel to your domain name. ex:
Onto the htaccess…
Once you have your .htaccess file, create a backup. ‘Copy & paste’ the file to your desktop and rename it as .htaccess-backup, We’re doing this just in case you make a mistake, you’ll just be able to remove the -backup from the name and re-add the .htaccess file back to your server.
Open up your .htaccess file, and add this below any other content that’s in this document.
For more on the htaccess file and WordPress security click here