What's better.
You have 20 javascript files. 10 are shared between all pages. Thus, they will be on the main page. Now what about these other 10? Say one page uses 4/10, another uses 4/10, and the other uses 2/10.
Would it be a) better to combine them all into one file (dynamically, of course), so only one http request will be made.
or
b) have 10 combined on the main page, then all other pages will be combined.
So, on some of my pages I would look at 4 or 5 java-script requests
- one of the master
- one for jquery from google cdn
- one for jquery ui from google cdn
- one for checking jquery from MS CDN
- for anything for this page.
Most of my scripts already use jquery live, because I use jquery ajax tabs, and I have to download all the scripts for each tab at the same time.
If not every time you switch to another tab, it loads a new javascript set so that it starts to execute binding events, such as clicking X, where X is how many times the user has loaded the same tab.
performance jquery
chobo2
source share