This is the first post in a series about improving website performance.
Here's a simple tip that can significantly speed up your website loading time in the eyes of your visitors. Since HTML defines the structure of your page and CSS defines how your website is presented, modern browsers hang onto your content until you tell them how it should be displayed. This behavior is called progressive rendering.
If you use
style tags throughout your page, or include external stylesheets in your page body,
most browsers avoid rendering until those styles are parsed. IE may avoid rendering entirely, leaving
your users to stare at a blank white page until everything is done loading. Declaring all of your styles
at the top of the page ensures that the browser can take full advantage of progressive rendering and display
content immediately. The HTML specification
confirms that all
<link> tags should be within the document
When a browser comes across a
script tag, it waits until that entire script executes before moving
on. Putting your
scripts immediately before your closing
</body> tag does two things:
Hope that improves the speed of your website! Read more tips at Yahoo.
All original work on this site is covered by a Creative Commons Attribution 3.0 license unless otherwise specified.
You may share or use any code or images from this site in any manner, for free, so long as reasonable effort has been made to give credit where due.
The views expressed in the posts and comments on this blog do not necessarily reflect those of my current or former employers.