How can I speed up the download time of the text and images on my company’s Web site? Is there any rule of thumb to go by?
The rules of thumb for speeding downloads from a Web site are similar to the rules for speeding applications in non-Web environments. In general, the more “stuff” you send from a Web server to a Web client, the longer your pages will take to load. Pictures, text and objects (such as ActiveX controls, Java applets and Flash movies) all consume bandwidth and all take time to send from Web server to Web client. The more you have, the longer it takes. For example, if you include very little text on your page, it would load faster…but it would not be very exciting.
There is a balance that must be struck between the amount of content that you include on a page and what that page should do. Fortunately, client-side scripting can give your pages dynamic functionality, making them more interesting, with very little cost in terms of download time. The scripts are simple text, but they can do many things on the client-side.
Currently, Microsoft Internet Explorer enables you to write script that will generate colors and graphics on the client, enabling Web page designers to use fewer image files in favor of using scripts to accomplish similar effects. This is a good thing: remember, the fewer images you use on a Web page, the faster it will completely load. Unfortunately, the current release of Netscape Navigator does not provide the same level of graphic control through scripts.
When you do use image files with your pages, use smaller images, if possible. If you simply must have a large image on your page, you can break the large picture into several smaller images. When the entire page loads into the browser, you will have arranged the smaller images so that they form a single, seamless larger picture. At the very least, this will enable users to see each of the smaller images as they come in, rather than waiting for the one big one (it will seem to take forever!). In this way, you are increasing “perceived speed”, which can be as important as actual speed.
If you are doing any server-side processing and are re-using data for each of the users of your site, you can load that data into RAM by copying the data into variables. You would access the data from those variables, rather than accessing a file or database for each users. This would speed the processing of your pages by reducing the number of times your code accesses the hard disk, which is much slower than RAM.
In general, the rules of thumb are that you should use common sense in building your pages. Reduce the amount of page content (especially images and objects), use client-side script whenever you can, and reduce the number of trips to your hard drive.