Tips for making your web faster
Now, we all make our little home pages and blogs. But when you upgrade to a full fledged web site and you get digg-ed, reddit-ed or I don’t know - Britney Spears flashes on your home page, you wish you had designed the site better to take the huge traffic load.
There are some things that, if you keep in mind while designing your site, can greatly reduce the number or HTTP requests made, or help you out in all those high traffic times.
- Intelligent use of images: A site without images, is well, boring to most people (unless you are a typography genius or craigslist). But, what can be done here? Besides optimizing your images for the web, for starters if you have many small images being loaded frequently, then you might considering using CSS Sprites. For example, all those digg/reddit/del.icio.us icons, instead of having multiple images for each, you can have one bigger image and use CSS sprites to make them work exactly the same way. This would reduce the number of HTTP requests that are made for your page to load. The trade off here would be complexity and maintenance. Who would have thought that this old skinning technique could become so useful to increase your web site’s performance.
- Be Lazy: They say the most creative people are also the most laziest. Well, if performance is the topic, I strangely couldn’t agree more.
Lazy loading of script files can help reduce the time it takes to load a certain page. - Design with speed in mind: When you are building that mega-web-site-portal of yours, make sure you put frequently used scripts and CSS inĀ separate global single files. It doesn’t matter if they are not related or if that would look weird together. There is a huge difference between loading 4 JavaScript/CSS files and loading just 2. You are basically reducing the number of HTTP requests made and in turn loading you page faster. This coupled with lazy loading is a killer solution. But once again, don’t go over board with it. Always remember that the future is maintenance.
- No inline stuff: Did I say not to put any script/style information inline? Eh, that should have been point number 1!. Reason - External files once loaded are cached by the browser.
- Let HTML be at top: If you want performance, make sure its the HTML which is on top.
Move your script tags to the bottom of your page. Browsers would pause till all the scripts are loaded, so it makes sense to put the script tags at the bottom of the page. The size of the page won’t change, but the perceived page load time would be far less. And believe me, its always the perception that matters rather than the actual reality. Take Vista’s file copy issues for example.
- Finally, read, read and read some more.
These are only a few tips that I could think of. I am sure there are many more such tips and hacks which can end up speeding up your site. Make sure you do proper data analysis, making a programming problem a mathematical + data problem will almost always solve your problem. ![]()
About this entry
You’re currently reading “Tips for making your web faster,” an entry on brokenTech
- Published:
- 3.15.08 / 9pm
- Category:
- tips and hacks
- Tags:
No comments
Jump to comment form | comments rss [?] | trackback uri [?]