It is fairly common knowledge that people hate to wait for websites to download and view. It is even easy to find studies which state that you only have between 4 and 7 seconds to get someone interested in your site, which means you’ve got to be fast.
What isn’t known so much is how to properly speed up your site.
What we normally think about improving
Reducing file sizes:
- Converting Gifs to PNGs – because PNGs are almost always smaller
- Saving graphics for web
- Reducing JPG quality (but not too much…)
- Smaller web content size
Improving your server so there are fewer:
- …other sites on it.
- …file request.
- …simplify server based code
- Or increase the servers bandwidth capacity.
All of these work, but they can be limiting in that it can only go so far by itself.
Other ways to improve the performance
There are other ways to improve your sites performance. This is because, depending upon how you layout your pages’ code, you can spend more time getting the browser to display a page, than you do downloading it, or worse yet you can “block” the downloading of a page if your not careful.
What is even worse is that some web tools (like Dreamweaver) and CMSes (like WordPress) may help you do it wrong when they help you write your HTML code if you let them.
Non standard, but potentially easy things to fix:
- Set a Far Future Cache – this lets the browser store the files, and not even ask to look for new files. Done on the server, but many people come to your site with no cached data – so this may have little effect, or a lot.
- Make sure all CSS is linked in the head tag. You can put a style tag in the body, but DON’T.
- Move JavaScript to the end of the page.
- Don’t use Cookies if you can avoid it. If you have to, don’t set them domain wide if possible.
- Pull images, CSS, etc from other domains (or sub-domains) to reduce “cookie poisoning”
- Reduce DNS lookups; which runs counter to last suggestion.
- Minify CSS and JS files – to help with Download time
Resources to look at:
- http://stevesouders.com/cuzillion/
- YSlow (http://developer.yahoo.com/yslow/)
Improving Web Performance was originally found on Access 2 Learn