We are currently in the great boom of Web 2.0 era. Websites have gone a long way since the Geocities days. Source code and asset files have gone bigger. Not to mention web developers spent hours deciding which file format to use just to squeeze down the file size so that the site could remain aesthetically pleasant yet fast. So why does speed STILL matter?

Quoting a blogpost about a research:

Researchers led by Dr. Gitte Lindgaard at Carleton University in Ontario wanted to find out how fast people formed first impressions. They tested users by flashing web pages for 500 milliseconds and 50 milliseconds onto the screen, and had participants rate the pages on various scales. The results at both time intervals were consistent between participants, although the longer display produced more consistent results. Yet, in as little as 50 milliseconds, participants formed judgments about images they glimpsed. The “halo effect” of that emotional first impression carries over to cognitive judgments of a web site’s other characteristics including usability and credibility.

Try clearing your browser cache and refresh your website, how long does it take to fully load? 2 seconds? 30 seconds?

If you are running a business on your site, potential customers might have already been turned off by the page load time. This might affect sales.

So what can you do to speed up your site?

Thankfully, there are a lot of great tools and solutions out there to help you optimize your site. For this post, I’ll introduce three techniques that I know of.

Use a Content Delivery Network (CDN)

Traditional server architecture is having your web hosting provider’s server serve up your website to the world wide web. Your website might load fast for users located near the server. But what if your most targeted customers or users span all across the other continents?

This is where CDN comes into play. CDN is a delivery network service. It is a service provider whereby they allow you to cache your site on their network of servers, at an affordable cost (some comes free) all over the world.

Big boys’ sites like Google and Facebook have the power and funds to buy servers and have them setup personally all across the world. For personal or small business sites, CDN services are the way to go. Now you do not have to worry about choosing a hosting provider that is closer to home.

These CDN services also come with additional perks like analytics and security. Some claimed that the analytics data are more accurate than script-embedded services because CDN are the ones that serve the site. Also, you are protected up to the latest threats since your site is under their wing of networks.

Minify all the things!

ZomboDroid06062013104020

It is okay for your source code to have proper indentation and spacings during development phase. But in production environment, you’d better off getting your source code and asset files like CSS and javascripts minified to reduce their file size down to a significant level. This will not only save you on bandwidth cost but also speed up the site for first time visitor.

It is also advisable not to change your source code too often in production environment because visitors will have to load up new versions of the source code each time you make a small change. So unless we are talking about critical bugs in the site, update the site by a huge batch of changes. Make use of the browser caching ability.

Analyze your site and further improve

There are a couple of tools out there that can help you analyze your site and suggest ways on how to improve your site like Yahoo!’s YSlow. For me I use Google’s PageSpeed extension. Install it and start analyzing your site today – it is free. I was able to score up to 99/100 points in my recent optimization attempt.

The one point missing is from third party fonts that I have no control on improving.

One thing to note is that even though the analyzer is a great way on improving your site, you still need to consider each suggestion that were thrown at you carefully. Each site is built differently so 100 points should be an ideal target but not a must-attainable score.

That is it!

With the three solutions that I suggested, that should give you a general idea on how and why you should speed up your website. If you have any other alternatives, do comment below. I would love to hear about your optimization techniques. Best siot!