Posted by: pressplaymedia on: November 18, 2007
A page’s loading speed is affected by 4 major things, server-side processing, client to server communication, size of data to be downloaded and rendering time.
This article will focus on the latter two – minimizing the data to be loaded and reducing browser rendering time. Here are some great tips and tricks:
First of all use this free online tool to analyze the performance of your page. It will provide you with some performance analytics and offer advice on how to improve your page’s loading time.
Web Page Analyzer at WebsiteOptimization.com
These solutions are so old or obvious they are becoming overlooked by newcomers, so I thought I’d mention them upfront:
Remove anything you don’t necessarily need
The mother of all optimization – remove those silly widgets , backgrounds, cursors, scripts and content you do not actually need from your website. Observe miraculous improvement!
Use external files for reusable code
If you are using any JavaScript or CSS code on more than one page, pack that into a separate external file and include it in all of the pages that depend on them. These external files can then be cached by your browser instead of read each time for each different page that uses it.
Do not rely on public web hosts for content hosting
Public web hosts can get really bogged down, especially during high-traffic hours and can add to loading time significantly. Avoid using external hosting services for images, scripts and widgets, instead try to host as much content on your own dedicated server. If you absolutely need those, you can use source ordering to position the source code of those items further to the bottom of the page’s source code. Some widget providers (like Google) openly endorse this for better user experience.
Avoid nested and full-page tables
This is probably the tip that will give you the most significant boost in browser rendering time. In order to render a table correctly, browsers must usually read the complete data of the table from start to end, thus large tables with lots of data will increase the perceived loading time of a page. The biggest bottleneck is if your whole web page layout in a single full-page table, which is forcing the browser to read through your complete page before it is able to render it correctly. You can eliminate the use of tables by designing tableless layouts with CSS, or at least eliminating full-page tables and breaking up large tables into smaller ones. This will not only optimize the page loading time for web visitors, but for mobile devices and other readers as well.
Source ordered content
Source ordering the content (or SOC for short) is a very useful and at the same time simple technique involving placing more important content to the top and less important content to the bottom of the source code and then laying it out using CSS. This will ensure that useful content (e.g. text and navigation) will load and display first, leaving the less important content (ads, footers) for last. Another benefit of this technique is that pages are more accessible to non-conventional readers and it is also reported that this technique adds to a page being more optimized for search bots and even producing better rankings.
Write valid code
Having all of your HTML code valid by W3C standards will eliminate the need for browser error-correction and thus speed up rendering time. You can use the W3C validator to check your site for any code formatting errors. No need to get obsessed with this though, there will always remain a few errors (external scripts, etc), however do try to keep your code as clean and valid as possible.
1. Minimize the number of images on your pages
- First of all, try to exclude from your page any images you don’t necessarily need. This is a pretty obvious tip, but many times the hardest thing to do ![]()
- Using CSS techniques like CSS sprites enables you to use only one big image which contains all of your navigation’s icons and backgrounds for example. This means only one request call must be made to the server to load a dozen of images!
2. Reduce the size of images on your pages
The most obvious ways to reduce the size of images is to reduce the actual width and height of the image files and use image compression, both methods producing smaller files for the client to download.
3. Use Height and Width tags
Specifying the width and height attributes of each image used on your page is vital in helping the browser render images faster (no need for the browser to read each image’s data and determine its size). Another benefit is that the page’s layout won’t change as the images load.
Just like any other data, CSS stylesheets and JavaScript code can eat up your bandwidth, especially on complex sites. Compressing and optimizing code will reduce it’s size by up to around 75%, which can be a great performance boost. However, make sure you always keep the original files archived and intact, because most compression tools are one-way solutions. These online tools will do the job in a simple and effective manner:
Thanks for reading, please leave any questions or suggestions in the comments below!
[...] all the details here [...]
Great article, I saw articles that talk about optimization, but none of them talked about all the aspects of client-size optimization.
Great job done here
, thanks.
[...] here Filed under: css [...]
A very resourceful website. Just came across it today, will bookmark it!
Excellent post. Improving speed by removing unnecessary files/widgets is such a no-brainer but not many people do the necessary cleanup.
[...] November 19, 2007 · No Comments Speed up your site : The Basics [...]
[...] Speed Up Your Site: The Basics « Pressplaymedia’s Blog [...]
Forgive me if this is a stupid question but does bandwidth optimization have anything to do with the speed? Would my ISP be able to speed up how quickly I can view sites by getting some kind of traffic shaping product?
Thanks for the info! Have you written any articles on traffic shaping that I could reference? Do you know of good products?
i think it,s a great post.
Thanks.
[...] Speed Up Your Site: The Basics A page’s loading speed is affected by 4 major things, server-side processing, client to server communication, […] [...]
great article, outlines the importance of page speed. Definitely a bookmark to reference.
I would also recommend this online free tool: http://Site-Perf.com/
It measure loading speed of page and it’s requisites (images/js/css) like browsers do and shows nice detailed chart – so you can easily spot bottlenecks.
Also very useful thing is that this tool is able to verify network quality of your server (packet loss level and ping delays).
November 19, 2007 at 7:22 am
Nice writeup!
If you allow I’d plug here a tool I did to help with the CSS sprites:
http://www.csssprites.com/
A small typo I noticed – in point 4.3. you meant width/height attributes, right, not tags?