Most websites are built for high-speed internet connections, even though there are plenty of people still on dial-up. There are many ways to make your site work much faster for all your users, dial-up and high speed alike. When a site is optimized, users are more likely to stay on the site longer and keep coming back for more.
Utilizing the browser’s cache
The browser’s cache can kill a lot of communications between the browser and the web server. To take advantage of the cache, you should limit the amount of data & code in the HTML. When a file is in the cache, the browser asks the server to send the page if it’s been modified since a certain date/time, if the browser does that.
Step 1: Use a stylesheet
Moving the style information into a stylesheet is priority #1. If you have 1500 bytes of style info inside the HTML doc and a user, on average, views 5 pages, that’s 7.5KB (3 seconds on dialup) per visit. Moving that data into a stylesheet means that the user only downloads the stylesheet once.
Step 3: Make use of CSS sprites
If you have 15 images that are on every page, that’s 15 files to download or 15 files to check for modification. Merging those 15 images into 1 larger image is fairly easy using GIMP or Photoshop. Once that is done, setting up the CSS sprites can be easy or difficult depending on how your HTML is setup.
A CSS sprite is a CSS background image using the height, width, background and background-position CSS attributes. If the image is a link, you’ll need to make a transparent image to place inside the link.
Step 4: Compress your images
This is, perhaps, the quickest and easiest way to speed up your site. GIMP and Photoshop allow you to set the compression level when saving the jpeg/gif/png. I’d suggest using 75% to 85% quality, but every image is different. You’ll have to play around with the setting a bit.
Step 5: Rework the HTML
Removing excess white space is one way. You can also rename CSS classes and element ids to a single letter, and remove any unneeded attributes altogether. This step is the most time consuming.
YSlow Firefox Extension
IMO, this is the best extension for optimizing a website. It gives you a letter grade and detailed information on how to improve your score. It does require Firebug, so make sure that’s installed first.