As you may have heard, Microsoft has created their on CDN for delivering JavaScript libraries. Beginning in ASP.Net 4 the ability to use scripts hosted on the CDN will be built into the ScriptManager control. ScottGu demonstrated how this will work in one of his blog entries. In addition to hosting their own AJAX library, Microsoft is also providing the jQuery library for download.
I am assuming that many of us have not jumped on this bandwagon as of yet This, I’m sure, is partly due to the fact that the MS AJAX libraries that are available are all beta editions slated for release with ASP.Net 4. However, the jQuery script that is currently provide is the current production release of the library and can be used today. When the next version of ASP.Net is released the number of users with cached copies of jQuery from Microsoft’s CDN will steadily rise. This will increase the benefit of using the scripts hosted there.
So in an effort to ready DotNetNuke to gain from this coming event, you can configure DNN to start pulling its jQuery script from the Microsoft CDN. Thanks to some relatively new features in DotNetNuke, this is a very simple process.
- Log into the portal using a SuperUser account.
- Navigate to the Host Settings page located on the Host menu.
- Scroll down to the jQuery Settings section located under Advanced Settings.
- Check the Use Hosted jQuery Version checkbox.
- Enter the following URL into the Hosted jQuery URL textbox.
- http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.min.js
- Click Update.
That is all there is to it. Now your DotNetNuke site will use the jQuery script on the Microsoft CDN. In the interest of full disclosure, I should state that not everyone will see a benefit from this change and each site should be evaluated independently. There is an ongoing debate on whether Microsoft developers should use Google’s CDN, Microsoft’s CDN or other hosting options when referencing the jQuery library. Be sure you do your homework to determine which is the best solution for your site(s).
Happy coding… err… configuring. ;)
P.S. I made a forum post here seeing what the interest of the Silverlight community is in having the Silverlight.js file hosted on the CDN. Please take a moment and post your thoughts. If enough of us support the idea, maybe Microsoft will consider adding it. http://forums.silverlight.net/forums/t/147867.aspx