Posted April 12, 2010.
Toronto & Burlington SEOs are now happy to be able to announce that website speed is a new ranking factor in Google’s algorithm. Thankfully Google has provided some hints under site speed in the Labs section of Webmaster Tools and a whole page which provides site performance suggestions related to using page speed. I will summarize those site speed performance suggestions here.
To set up asynchronous tracking you simply need to replace your current Analytics script with the following:
var _gaq = _gaq || ;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
Pay special attention to this line in code in the script above and change it to your current property ID. Your current property ID is found in the Analytics code you are now replacing.
Make sure to check the status of your script in your Google Analytics account to make sure it is receiving data.
Optimize the order of styles and scripts
Minimize DNS lookups
Straight from Google on this one: “Reducing the number of unique hostnames from which resources are served cuts down on the number of DNS resolutions that the browser has to make, and therefore, RTT delays.” The entire piece of information regarding the reduction of DNS lookups is quite lengthy and technical so I’ll summarize it here: Try your best, your very best to reduce the number of domains/hosts that your files come from OR try to reduce the number of external files you use on your site especially during initial load time.
Combine external CSS
This is straight forward and even slightly intuitive. It’s almost second nature to cut the corner a little bit by placing all your CSS code into one file and is conducive to a faster loading website. Again one file, one call – responses to CSS calls are usually quick and combining your CSS references into one file can only benefit your site with respect to site speed. There generally aren’t any problems related to putting all your CSS code into one stylesheet.
Enable gzip compression in your .htaccess file
Enabling gzip compression in your .htaccess file can substantially reduce the size of the files being sent from the server to your users computers (the browser). By enabling gzip compression within your .htaccess file you’re telling the server to compress (zip) the file before it is sent to the users browser. Compressing the file can make it substantially smaller and thus substantially reduce the load time of your pages.
Simply add the following directive into your .htaccess file.
# compress all text & html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml
# Or, compress certain file types by extension:
Make sure to reload your website in your browser after applying this code to ensure it is working properly. Seriously.