The speed at which your site loads has a direct impact on both your search engine results and the likelihood that a visitor will become a repeat visitor. Slow is bad. Luckily, there are plenty of techniques to increase your page load times. Here are a few of them.
Simplify the Design
Not always an option but when designing a website, or revisiting an existing design, take stock of what elements are slowing your load times down and whether they are really needed or not. Google’s Chrome browser comes with Developer Tools which is an easy way to see what files are slowing you down. Firefox has the Firebug addon. There are plenty of other ones available to analyze your page load times. Work your way down from the largest files, trying to reduce their size as much as possible, then start in with the smaller ones.
Reduce Database Queries
If you have a database driven website be aware of how and how many times your database gets queried.
Minimize HTTP Requests
Every time a request goes out it stops everything else from loading until it is finished. Reducing requests helps prevent bottlenecks from slowing your website down.
CSS Sprites are a great way to reduce HTTP Requests. A css sprite is a combination of many different small images in one larger image. Using css you can show only the little piece of the image you need in each place. So instead of having 10 little individual images you have one larger image. Here is a little tutorial on css sprites from CSS Tricks.
Cache Static Content
Even in highly dynamic websites there is plenty of static content. Make sure your images and any static content are cached.
Here is an example from HTML Boilerplate.
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
# cache.appcache needs re-requests
# in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Your document html
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# RSS feed
ExpiresByType application/rss+xml "access plus 1 hour"
# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
Not all hosting is the same. If your site is on a cheap shared hosting plan especially, you could be seeing some lengthy load times because of it. Shared hosting services are pretty notorious for jamming way to many sites onto a server. Which means your sites load times are dependent on the traffic of those other websites. If you can afford it try to at least get on a dedicated virtual server.
There are many ways to optimize load speeds. What are some techniques you’ve used to reduce load times?