Three Rules for Building Fast-Loading Web Pages
Designing lean, mean, fast-loading Web pages should be the goal of every Web designer. After all, Web users are in a hurry: If they can't find what they want quickly and easily, they will go elsewhere.
Visitors to your site are certainly not going to wait around for a minute or more for a single page to download. In fact, some experts claim that if your home page does not load within eight seconds, as much as a third of your site visitors will get frustrated and leave.
But once you squeeze all the essential information on your pages, not to mention the fancy graphics and JavaScripts, page size can get out of hand. Here are some tips to make sure your site downloads before users give up.
1. Strip down your code: Many programs will add unnecessary code to your Web pages. Get rid of it. Over time, as you edit your Web pages, you will probably leave behind some extra tags. Clean this up, too. Many Web development programs have tools to identify and remove unused code. Use them. Learn to use CSS (cascading style sheets), as they produce cleaner code and make sitewide style changes much easier. A CSS-designed page can present the same information and layout as an HTML page using one-third the amount of code.
2. Use graphics, scripts, and Flash judiciously: These are some of the worst offenders of page bloat. Decide what you absolutely have to have and get rid of the rest. For those large files that you can't live without, make sure they're optimized. Image files such as GIFs and JPEGs are the easiest to optimize. Photoshop, Illustrator, and many other programs will show you how big each image file is, and there are many third-party applications that will help you optimize your online images. A Web search will turn up a number of such programs. Use text links instead of graphic "buttons" whenever possible. And never use images to display blocks of text.
3. Keep it simple: Look at Google's home page; one image and a select number of text links mean that page downloads in fractions of a second with a standard broadband connection. No wonder that experts often point to Google as the shining example of page size and download optimization. You do not have to limit yourself to one image on your home page, but you would do well to follow Google's example. Keep your pages light, and users will reward you with more traffic.
So how does your site stack up? Try one of the many free online load-time tools. That should tell you where you fall in the continuum: Are you a tiny Google, or are you a bloated goliath? Ideally your front page should be less than 250K (including images), but this will vary depending on how graphic-intensive your site is.
If you have already tried these tips and still can't get your pages to come in under the eight-second mark, maybe your site architecture needs another look. Are you putting too much information on each page? Can your pages be subdivided in a logical way? Many users will be perfectly happy to wait for two six-second pages rather than one twelve-second page, as long as they can find what they want.