Microsoft launches major new Content Distribution Network that can add AJAX features to any website

Microsoft has just announced a useful new CDN service that any website can use, at no cost, to add rich JavaScript functionality and Ajax.

This move by Microsoft is a big deal. It’s an important milestone in the evolution of mainstream web architecture. The new service will influence the way in which many websites and many web developers work -- forever.

Web developers can start using the new service right now. It provides hosting for super-fast optimised delivery of static assets such as JavaScript -- including the JQuery and ASP.NET AJAX libraries. A key advantage of a CDN is it that can serve the assets much faster than most web sites would, meaning web pages load much faster.

The service is free to use and open to everybody. It’s a convenient way to reference JavaScript files. You don’t need to use Microsoft development tools to take advantage of JS libraries. However, Visual Studio does make it so much easier to develop JavaScript and Ajax web applications, with seamless integration of JS libraries with the development environment, providing powerful features like drag-and-drop web development in design view and code view, and IntelliSense predictive code auto-completion when coding by hand, etc. ASP.NET developers get built-in CDN support through the EnableCdn attribute of the ScriptManager control.

The ASP.NET AJAX library is often overlooked by developers who don’t specialise in Microsoft technology, but it’s a very useful resource that everybody can use. I hope the CDN will tempt more web developers and user-experience designers to see what’s on offer. Microsoft has packed some really useful features into its JS libraries, offering impressive features such as seamless support for the back/forward buttons of the web browser out-of-the-box. If you’ve used Live Mail lately (formerly Hotmail), you’ve probably seen it in action already. For example, if you click on an email in your Live Mail inbox and then click the browser’s back button, Microsoft's JS magic automatically ensures that you return to the inbox in exactly the same way as you would if the web site did not use Ajax. It’s a flawless user experience, yet this type of capability is still not common on Ajax web pages, and historically this type of functionality has not been easy to implement.

Top 3 advantages of using a CDN to host JavaScript

Examples of HTML to reference JavaScript libraries on Microsoft's AJAX CDN

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

<script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjax.js" type="text/javascript"></script>

16 September 2009

Share the love:

Comments: 8

Add Comment

Tim Acheson (16 Sep 09, 11:27)

I just want to emphasise that it's ideal, and indeed widely considered best-practice, to host static assets in a way that is optimised for the purpose, typically on a separate domain, with far-future expiry headers, no cookies, minimising HTTP overhead and maximising performance.


Simpson's did it!

Oh, wait, no... it was Google.

http://googleajaxsearchapi.blogspot.com/2008/05/speed-up-access-to-your-favorite.html


Oh, and Yahoo!

http://developer.yahoo.com/yui/articles/hosting/

Tim Acheson (16 Sep 09, 16:20)

I would happily use JS URLs served by Google's or Yahoo's infrastructure... I would certainly be interested in trying some benchmarking from here in London to see if they perform as well as Microsoft's new CDN...

However, unfortunately, neither Google or Yahoo include the ASP.NET AJAX library, which is actually really useful. I don't know why these companies omit Microsoft's mainstream JS library. Perhaps it's for commercial reasons (that would be characteristically anti-competitive). Perhaps some of the folks at these companies are unable to get over the anti-MS chip on their shoulder.

(Google launched their JS library CDN last year, and have not yet included Microsoft's JS libraries. Yahoo launched their JS hosting service the previous year for YUI, but neglected to offer an option for JQuery and Microsoft's JS libraries.)

Tim Acheson (17 Sep 09, 13:08)

Download speed

Microsoft's JavaScript URLs perform slightly faster than Google's here in London in the UK. I'd be interested to hear how the two CDNs compare in other geographic locations.

To compare the relative performance of Microsoft's and Google's CDNs, I executed a simple benchmarking test. The average time taken to download the JQuery 1.3.2 JavaScript file once was 777.1 ms from Google and 320.8 from Microsoft. The average is calculated from the results of ten separate identical downloads. The raw data is provided below.

I also measured the average time taken to download the file ten times as rapidly as possible (in a for loop), repeating this test ten times and calculating the mean time taken to serve ten rapid consecutive downloads. Google completed the test in 1077 ms on average, with a fastest recorded time of 937 ms. Microsoft completed the test in 1015 ms on average, with a fastest recorded download of 749 ms.

Time taken to download raw JQuery JavaScript file (milliseconds).

Google Microsoft
1327 1218
812 140
281 265
701 302
499 249
604 211
984 171
609 234
711 309
1187 109

These tests were performed out over a standard commercial leased line (20 MB symmetric, uncontended) in London. Later I’ll try it over a standard fibre-optic cable broadband connection (up to 20 MB down).

Tim Acheson (17 Sep 09, 13:09)

Notes

  • Google's file sizes are slightly smaller, due to the encoding of the text file. Thus, Microsoft could easily improve performance further with an alternative encoding format.

    http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js (57.9 kb)
    http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js (55.9 kb)

    http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.js (124 kb)
    http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js (117 kb)

  • Official web pages listing the download URIs:

    http://www.asp.net/ajax/cdn/#2
    http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery

  • The response from Google's infrastructure lacked useful metadata like MIME type and file size.

  • Personally I prefer Microsoft's CDN regardless of the marginal performance increase, because it includes the MS AJAX libraries which are really useful.
Tim Acheson (21 Oct 09, 10:05)

Update

Last night Microsoft's social web guy, James Senior, asked me for the raw data from my comparison of Microsoft's Ajax CDN with Google's. It's for a Microsoft white paper on web platform performance which he's he's writing. (You may be familiar with Senior's original blog on Technet.)

I ran a simplified version of the test, and posted the results on my SkyDrive. I also uploaded a C# code example in the same folder, in case this is useful to anybody wanting to run similar tests.

In last night's test, I simply sent HTTP requests at 10 second intervals and measured the time taken to receive the whole JavaScript file for the latest version of the JQuery library. I used a random query string to prevent caching. Obviously download speed can vary greatly with time and location, but these are my results here in London, in the South East of England.

My results are conclusive: Microsoft's Ajax CDN delivered the JavaScript file more than twice as fast as Google's.

Tim Acheson (19 Mar 10, 07:39)

It's worth noting that ASP.NET Ajax will become less important in the future, with JQuery being Microsoft's preferred JavaScript library. We already have seamless JQuery integration in Visual Studio for for ASP.NET web development. MS will increasingly be contributing to the JQuery project, as announced at Mix10. I welcome this direction for Microsoft! :) [Full credit to James Senior who kindly emailed me about this yesterday.]

Tags:


  • Twitter
  • LinkedIn
  • Facebook
  • Windows Live / Messenger
  • Xbox Live
  • RSS
  • Email