Tuesday, September 29, 2009

Microsoft AJAX CDN

Microsoft AJAX CDN

Recently Microsoft has launched a new Microsoft Ajax CDN (Content Delivery Network) service that provides caching support for AJAX libraries (including jQuery and ASP.NET AJAX).  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.


CDNs are composed of "edge cache" servers that are strategically placed around the world at key Internet network points.  These "edge cache" servers can be used to cache and deliver all types of content – including images, videos, CSS and JavaScript files.


Using a CDN can significantly improve a website's end-user performance, since it enables browsers to more quickly retrieve and download content. Basically, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster – which makes your pages load quicker). 


e.g.  Instead of using the hard path approach, better is to use CDN.


<script src="Path with your Web Server" type="text/javascript"></script>

<script src="" type="text/javascript"></script>  // CDN Approach



Using CDN with the ASP.NET 4.0 ScriptManager


In addition to allowing you to reference script files directly using a <script> element, ASP.NET 4.0 will make it easy to use the CDN from ASP.NET Web Forms applications that use the <asp:scriptmanager/> server control as below.


<asp:ScriptManager ID="atlSMMaster" EnableCdn="true" runat="server">



When you enable the CDN with the ScriptManager, the application will use the Microsoft CDN to request JavaScript files automatically i.e your application will retrieve all JavaScript files that it normally retrieves from the System.Web.dll or System.Web.Extensions.dll assemblies from the CDN instead.  This includes both the JavaScript files within ASP.NET AJAX, as well as the built-in Web Forms JavaScript files (for example: the WebUIValidation.js file for client-side validation, and the JavaScript files for controls like TreeView, Menu, etc).


This provides a nice end-user performance improvement, and means that users accessing your ASP.NET website won’t need to re-download these files if they have visited another ASP.NET website that uses the CDN.



Reference: Link


Hope this helps.


Thanks & Regards,

Arun Manglick || Senior Tech Lead



No comments:

Post a Comment