Speed Up Your Web Site

Published Date
01 - Sep - 2007
| Last Updated
01 - Sep - 2007
 
Speed Up Your Web Site

Broadband may have arrived in India, but it hasn't gone mainstream: the large majority of people are still on dial-up. As for the broadband we have, it isn't exactly blazing fast… but bandwidth is getting cheaper, and so are Web hosting solutions. Here are some of the simpler things you can do while creating and maintaining your site to make it just that little bit faster.

Keep Images In Check
Images are, obviously, the biggest culprits when it comes to slowing down a site. In these times of Web 2.0, you find sites littered with images. Every single image means a separate request sent to the server. Use image maps: they bring down the number of requests. Image maps are basically single images with small sections within it, which can be used to link to other pages or images.

Image compression also plays a role in slowing down pages and sites. GIFs load faster than JPEGs, but don't match their quality. So use GIFs in less important places like banners and icons, and JPEGs for higher-quality content.

Compressed Pages
Most often, large pages are filled with redundant text and HTML code. You can have your site compress data before sending it to the client.
The compression module for the Apache Web server-mod_gzip (
http://sourceforge.net/projects/mod-gzip/) is one of the most well known. Many Web servers today come with inbuilt support for compression, and the ones that don't use third-party modules like in Apache's case to implement the feature. Such compression techniques not only speed up your site, they also might bring down bandwidth bills by sending smaller amounts of data.

Avoid Unresolved Domain Names
A large number of images and other components in your page linked to different sites by their domain names can delay page loading. Every domain name has to be resolved by the client's DNS server… Wherever possible, link using the IP addresses of the servers.

Select The Nearest Host
Location and routing to your Web hosts plays a fair role in the matter. If your site audience is in India, hosting a site overseas would mean that every transaction will have some delay because of the number of nodes of equipment it has to go through. On an average, the delay between a client and a server in India depending on the locations could be anything between 10 and 70 ms. A site in the US, for example, could have a delay as much as 250 to 300 ms or higher. Clearly, local servers are a better option. Routes are paths set by the ISP for data to pass through, and it's a good idea to check the delays before choosing a Web host.

Site Inspection Tools
There are some software and sites that point out mistakes or poorly-written code. One such is a plugin for Firefox called Firebug, which can be downloaded from
www.getfirebug.com. It allows you view the code of a page and make changes to it. The changes are reflected in real-time for you to see. It also gives statistics of all the images and scripts downloaded from a particular site and the time taken. 

Firebug-a Firefox plugin-show statistics and allow real-time modifying of code 


Opera's Developer Console is the alternative to firebug on Opera

Opera has a similar add-on that can be downloaded from the Opera site. Select Tools > Advanced and then go to the Developer console, or you can directly go to
http://dev.opera.com/tools. Scroll down to the Opera Developer Console tool and drag the tool icon from the page to a toolbar in Opera. When on any site, you can click that button, and a little window will load-which, like Firebug, will allow the making of changes to the page, and will also allow viewing statistics and other information on it. 


Yahoo's YSlow grade code and give suggestions to improve it

There's an add-on for Firebug; it's Yahoo!'s YSlow, downloadable from
http://developer.yahoo.com/yslow. Click on the YSlow icon at the right bottom of the Firefox window, and it gives you a list of flaws if any, and tweaks that can help fix the page. YSlow also gives an overall grade to the page!

Clean Up Your Code
WYSIWYG HTML editors are notorious for leaving blank, unnecessary tags; many of them end up creating un-optimised, larger files. Use the cleanup feature in your WYSIWYG editor to optimise your code, and even manually go through the code for empty tags and comments before uploading it to your site.