Microsoft recently announced that they are going to provide Content Delivery Network support for Ajax and Jquery. This is a great idea as developers can link the jquery to Microsoft site rather than including it in the project. There are few benefits of this:
- No need to maintain duplicate jquery or Ajax files in the project. Just add a reference to a URL to Microsoft provided URL.
- Surely page loading will be faster as the script is loading from a different domain. Browser as usual doesn't allow to load multiple resources from server while loading js file. So browser can request for two or more image files from a server simultaneously, but can request for single js file per server and while loading js file browser stops requesting any other file to the same server. Now as the js file is deployed on different server, so page loading will be definitely faster.
- Currently for multiple sites, you are deploying the common JavaScript file (say jquery file) multiple times. So for site 1, the URL of the jquery file is http://www.site1.com/js/jquery-1.2.3.js. For site 2, the same jquery file is deployed as http://www.site2.com/js/jquery-1.2.3.js. So browser is loading the same version of query file for a different site. Now if you add CDN reference, then the same jquery will be used for multiple sites. And as browser caches js file, once the js file is cached for site 1, for site2 the js file will not be download.
We can expect such type of CDN network for other common components. Details can be found here on the ASP.NET site.
CodeProject