Great Tips From Google To Speed Up Your Websites

Posted April 12, 2010 by .

 

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.

Asynchronous Tracking
To set up asynchronous tracking you simply need to replace your current Analytics script with the following:

<script type="text/javascript">// <![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// ]]></script>

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.

_gaq.push(['_setAccount', 'UA-XXXXX-X']);

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
Simply put, the browser delays rendering all code after JavaScript has been downloaded, parsed and executed. Therefore Google’s suggestion is to place all you the references to your external CSS files before you load your JavaScript files. For example if a file is being downloaded when a JavaScript file is referenced for download, the JavaScript file is downloaded in parallel with the first file and in essence, will reduce the speed at which the first (possibly smaller) file is downloaded.

Combine external JavaScript
This would be listed in your on-page SEO proposal most likely as: Combine all external JavaScript files into one so as to reduce the number of calls to the server during page load. It’s obvious that this could contribute to page load speeds but remember two things: a. it isn’t always easy or beneficial to combine code from one JavaScript file into another as conflicting issues could arise. Remember putting all your JavaScript code into one file may take some time to work properly too. b. some of your JavaScript code may not ever work if it is combined with other JavaScript files successfully for a myriad of reasons. If that is the case you’ll just have to settle with a separate call to the server for that file. That’s OK though. It’s not the biggest problem but do your best to combine as many JavaScript files as you reasonably can.

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 &amp; html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# Or, compress certain file types by extension:

SetOutputFilter DEFLATE

Make sure to reload your website in your browser after applying this code to ensure it is working properly. Seriously.

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)


One Responseso far.

  1. [...] how to do technical things like writing decent and validating XHTML and performing such tasks as speeding up your website according to Google’s webmaster [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>