Princeton
09-14-2009, 10:00 PM
Competition is increasing on the Web. If your site is slow you will lose to your competitors. To improve web page performance (speed), you can do a number of things:
increase number of servers
tweak your server(s)
modify your web pagesThis article will focus on modifying your web pages to increase performance.
As you are aware, today's browsers are faster than earlier versions. They have changed functionality to help improve speed. By understanding how browsers function, you will be able to increase your web page performance.
Learn everything that you can about browser functionality....
http://www.browserscope.org/ is a great resource that charts how different browsers function.
The Easiest Thing You Can Do To Improve Web Page Performance:
Use less <tables> - if a product requires you to wrap large chunks of code within a <table> you should think twice about it
Remove unnecessary objects, features, and plugins.
Reuse static files across multiple domains. eg. images, css, js, etc
Use less javascript - if a product requires additional javascript you should think twice about it; javascript blocks everything from loading (in parallel) until completely loaded and processedJavascript blocks other files from downloading - It also needs time from processing. So, the less you have the faster your speed.
http://content.screencast.com/users/Joe_Velez/folders/Snagit/media/a6776b46-5504-422f-9f07-7e7787ffbd60/09.15.2009-17.58.22.png
Read more about how <tables> affect speed...
How Design Affects Performance : Progressive Rendering (https://vborg.vbsupport.ru/showthread.php?t=161099)
Additional information...
How Design Affects Performance (https://vborg.vbsupport.ru/showthread.php?t=160502)
Increase Download Parallelization - Use A CDN Such As Amazon S3:
Increase download parallelization by increasing the number of resources that serves static files. In other words, if you have many static objects* on a page split them across multiple domains.
*static files - includes stylesheets, images, swf, etc
The reason why this works is because each browser allows a maximum number of connections per hostname. In modern browsers, this number has increased to 6 (avg). What this means is that your browser will try to download 6 objects from any hostname at the same time. So if you increase the number of resources that serve static files it's more likely that you will decrease page display time.
In comparison, older browsers such as IE 6 only allowed 2 maximum connections per hostname.
Move all your static files to a CDN such as Amazon S3 (http://aws.amazon.com/s3/). Doing so will provide you with the following:
decrease server load
decrease bandwidth
decrease cost
decrease page display timeGet yourself an S3 account ASAP!
I recommend using a different domain other than your site domain. The reason behind this is that you don't want your cookies associated with each static file.
There's no need to associate cookies with static files.
Some cookies can be as long as 1k which will increase your time.the following image is a snapshot of the headers of a downloaded image...
http://content.screencast.com/users/Joe_Velez/folders/Snagit/media/dda0fd9d-caba-43df-baf2-d1b7654ebabf/09.15.2009-17.19.49.png
Getting Started
I elect to use .info domain for static files as they are offered on the cheap - $1.99.
For example, if your site domain is domain.com ; you should purchase domain-file.info to serve your static files.
(Note: It can be any domain just as long as it's different from your site.)
Setting Up Your Domain
Once you get your domain you can point it to your amazon s3 server account (url). This is done by adding a CNAME entry for each sub-domain that you want to create.
I created the following sub-domains:
js.domain-file.info to serve javascript files
css.domain-file.info to serve stylesheets
img.domain-file.info to serve images
img2.domain-file.info to serve images
icons.domain-file.info to serve icons if you have a large amount of iconsTo upload files, I highly recommend using a commercial product called Bucket Explorer (http://www.bucketexplorer.com/). There is a free Firefox extension, S3Fox Organizer, that provides a GUI interface but it lacks a lot of features.
Whatever you use - make sure that you can alter headers.
You will need to add EXPIRES header so that the static files are cached - saving you bandwidth and decreasing overall page display time.
Other Things You Can Do To Speed Up Your Pages (in no particular order):
combine javascript (to decrease http request)
move javascript to the <head> or to the footer (below any content)
decrease number of inline javascript
combine css (to decrease http request)
combine images using sprites (to decrease http request)
load css prior to any javascript calls
compress images Compress Javascript & Stylesheets:
To further decrease page display time, I recommend compressing (gzip) your js and css files. You will then have to create a plugin to show the gzip version if browser is capable of displaying if not show the uncompressed version.
Most modern browsers are capable of displaying compressed files. However, IE6 is known to have some issues - yes, even the SP2 which was reported to have this fixed is still buggy.
Tools To Help You Get Started
Firebug (http://getfirebug.com/)
YSlow (http://developer.yahoo.com/yslow/)
Page Speed (http://code.google.com/speed/page-speed/) by Google
increase number of servers
tweak your server(s)
modify your web pagesThis article will focus on modifying your web pages to increase performance.
As you are aware, today's browsers are faster than earlier versions. They have changed functionality to help improve speed. By understanding how browsers function, you will be able to increase your web page performance.
Learn everything that you can about browser functionality....
http://www.browserscope.org/ is a great resource that charts how different browsers function.
The Easiest Thing You Can Do To Improve Web Page Performance:
Use less <tables> - if a product requires you to wrap large chunks of code within a <table> you should think twice about it
Remove unnecessary objects, features, and plugins.
Reuse static files across multiple domains. eg. images, css, js, etc
Use less javascript - if a product requires additional javascript you should think twice about it; javascript blocks everything from loading (in parallel) until completely loaded and processedJavascript blocks other files from downloading - It also needs time from processing. So, the less you have the faster your speed.
http://content.screencast.com/users/Joe_Velez/folders/Snagit/media/a6776b46-5504-422f-9f07-7e7787ffbd60/09.15.2009-17.58.22.png
Read more about how <tables> affect speed...
How Design Affects Performance : Progressive Rendering (https://vborg.vbsupport.ru/showthread.php?t=161099)
Additional information...
How Design Affects Performance (https://vborg.vbsupport.ru/showthread.php?t=160502)
Increase Download Parallelization - Use A CDN Such As Amazon S3:
Increase download parallelization by increasing the number of resources that serves static files. In other words, if you have many static objects* on a page split them across multiple domains.
*static files - includes stylesheets, images, swf, etc
The reason why this works is because each browser allows a maximum number of connections per hostname. In modern browsers, this number has increased to 6 (avg). What this means is that your browser will try to download 6 objects from any hostname at the same time. So if you increase the number of resources that serve static files it's more likely that you will decrease page display time.
In comparison, older browsers such as IE 6 only allowed 2 maximum connections per hostname.
Move all your static files to a CDN such as Amazon S3 (http://aws.amazon.com/s3/). Doing so will provide you with the following:
decrease server load
decrease bandwidth
decrease cost
decrease page display timeGet yourself an S3 account ASAP!
I recommend using a different domain other than your site domain. The reason behind this is that you don't want your cookies associated with each static file.
There's no need to associate cookies with static files.
Some cookies can be as long as 1k which will increase your time.the following image is a snapshot of the headers of a downloaded image...
http://content.screencast.com/users/Joe_Velez/folders/Snagit/media/dda0fd9d-caba-43df-baf2-d1b7654ebabf/09.15.2009-17.19.49.png
Getting Started
I elect to use .info domain for static files as they are offered on the cheap - $1.99.
For example, if your site domain is domain.com ; you should purchase domain-file.info to serve your static files.
(Note: It can be any domain just as long as it's different from your site.)
Setting Up Your Domain
Once you get your domain you can point it to your amazon s3 server account (url). This is done by adding a CNAME entry for each sub-domain that you want to create.
I created the following sub-domains:
js.domain-file.info to serve javascript files
css.domain-file.info to serve stylesheets
img.domain-file.info to serve images
img2.domain-file.info to serve images
icons.domain-file.info to serve icons if you have a large amount of iconsTo upload files, I highly recommend using a commercial product called Bucket Explorer (http://www.bucketexplorer.com/). There is a free Firefox extension, S3Fox Organizer, that provides a GUI interface but it lacks a lot of features.
Whatever you use - make sure that you can alter headers.
You will need to add EXPIRES header so that the static files are cached - saving you bandwidth and decreasing overall page display time.
Other Things You Can Do To Speed Up Your Pages (in no particular order):
combine javascript (to decrease http request)
move javascript to the <head> or to the footer (below any content)
decrease number of inline javascript
combine css (to decrease http request)
combine images using sprites (to decrease http request)
load css prior to any javascript calls
compress images Compress Javascript & Stylesheets:
To further decrease page display time, I recommend compressing (gzip) your js and css files. You will then have to create a plugin to show the gzip version if browser is capable of displaying if not show the uncompressed version.
Most modern browsers are capable of displaying compressed files. However, IE6 is known to have some issues - yes, even the SP2 which was reported to have this fixed is still buggy.
Tools To Help You Get Started
Firebug (http://getfirebug.com/)
YSlow (http://developer.yahoo.com/yslow/)
Page Speed (http://code.google.com/speed/page-speed/) by Google