Introduction to Microsoft Ajax CDN features free AJAX cache support

Source: Internet
Author: User
Tags classic asp

Http://dotnet.chinaitlab.com/ASPNET/815224.html

Microsoft Official information: HTTP://WWW.ASP.NET/AJAXLIBRARY/CDN.ASHX

Microsoft has launched a new AJAX tool: an AJAX CDN. This tool was launched by Microsoft's ASP.net team for Ajax caching support. Want to know some of the details of the Ajax CDN. Then look at Scott Gu's introduction to it.

Earlier today, ASP. The NET development team 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 free of charge and does not require any registration and can be used for commercial or non-commercial purposes.

 what the CDN offers.

Content distribution Networks (CDNs) are made up of "edge cache" servers strategically positioned around the world's key Internet network points. These "Edge cache" servers can be used to cache and distribute various types of content, including pictures, videos, CSS, and JavaScript files.

Using a CDN can significantly improve the end-user performance of a Web site because it allows browsers to get and download content faster. For example, for a picture request, the browser no longer needs to be downloaded across the Internet to your Web server, a CDN can provide services directly from a neighboring "Edge cache" server to satisfy the request. And the Edge caching server may be far away from your client with only one network hop (single network Hop) (make it return very quickly and also make your Web page load faster).

  What Microsoft Ajax CDN offers.

The Microsoft Ajax CDN greatly facilitates the addition of jquery and ASP.net Ajax script libraries to your site, and automatically provides these scripts by our thousands of geographically positioned (geo-located) edge caching servers around the world.

For example, if you want to use the Microsoft Ajax CDN jquery, you simply add a standard script identifier to the Web page with the following URL:

<script src= "Http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type= "Text/javascript" ></script > When the script file is requested by the browser, it is automatically provided by the "Edge cache" server closest to the end-user's CDN. This means:

Request processing is much faster than accessing your Web server (allowing end user Web pages to load much faster)

You don't have to pay for the bandwidth of the file because the file comes from the server we pay for the bandwidth (saves you money)

Scripts can easily cross-station caching, which means that if a user has just visited a Web site that has requested the file, the file will no longer need to be downloaded (because the file already exists in the browser's cache)

You can get a complete list of the JavaScript libraries (and related URLs) we have loaded into our CDN cache here in Www.asp.net/ajax/cdn.

When a new ASP.net ajax version is released, we update the library in the CDN and continue to update it to include all JavaScript files (including jquery, jquery verification plug-ins) that are released with ASP.net and Visual Studio. and other libraries that will be released in the future.

CDN Services are free and available to anyone in the community and can be used for both commercial and non-commercial purposes. You don't have to register to use it.

Using the Microsoft Ajax CDN in asp.net 4.0 ScriptManager

In addition to allowing you to reference script files directly using <script> elements, ASP.net 4.0 simplifies the use of CDN from ASP.net Web forms applications that use <asp:scriptmanager/> server controls.

asp.net 4.0 <asp:ScriptManager> control contains a new attribute named "Enablecdn", after you give this property a true value, your application will automatically use the Microsoft CDN request JavaScript File:

After you enable CDN via ScriptManager, your application will obtain all JavaScript files from the CDN that are usually obtained from the System.Web.dll or System.Web.Extensions.dll assemblies. This includes JavaScript files in asp.net ajax, as well as built-in Web Forms JavaScript files (for example, webuivalidation.js files for client validation, and for the image TreeView, JavaScript files used by controls such as menu.

This provides a good end-user performance improvement and means that users who visit your ASP.net site no longer need to download these files if they have ever visited another ASP.net Web site that uses CDN.

using the ASP.net Ajax Fifth preview version of the CDN

In addition to the introduction of AJAX CDN station outside, ASP. NET Development team has recently released a fifth preview of ASP.net ajax. You can download the fifth preview version of ASP.net ajax (with routine code) on the CodePlex http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770.

Now, by adding the following script to the CDN, you can use the ASP.net AJAX library:

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

</script>

<script src= "Http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjaxTemplates.js" type= "Text/javascript" >

</script>

These script identities refer to the beta version of the ASP.net Ajax Library released in September 2009 (the/0909/portion of the URL represents the year and month of the ASP.net Ajax release).

After adding a script identifier that references the ASP.net Ajax library, you can start using the library on your Web page. For example, the following code represents a DIV element that is attached to a page body by the client DataView control for a group of photos.

The DIV element, whose ID is "photos", contains a template that formats each photo in the photo array, and the photo element declares:

When display (render) DataView, the contents of the photos div element are displayed for each photo in the photo array (render), with the result that the following photos are displayed:

Because ASP.net Ajax is a pure JavaScript library, the code above works perfectly in asp.net web Forms, asp.net MVC, HTML, and even classic ASP pages, and it works in all modern browsers.

You can download the routine code on the CodePlex Project home page to learn the details of ASP.net Ajax fifth preview.

Here are a few blog posts that delve into the features of the fifth preview of asp.net Ajax:

Microsoft Ajax 4 Preview 5:the DataView Control--Dave Reed explains how to take advantage of the newly added dynamic template and placeholder controls (placeholder) features in the fifth preview.

asp.net Ajax Preview 5 and Updatepanel–jim Wang explains how to use the fifth preview in the existing Web site that uses the standard ASP.net UpdatePanel control.

Building a class browser with Microsoft Ajax 4.0 Preview 5–bertrand Le Roy built a cool Ajax class library Browser application that took advantage of a number of new features in the fifth preview, including recursive Template (recursive template).

How the DataContext can change your data and your life (OK, sort, but not really) –jonathan Carter has a wonderful post series that delves into Ajax DataView and DataContext.

Conclusion

Microsoft Ajax CDN enables you to significantly improve the performance of the ASP.net Web forms and ASP.net MVC applications that use asp.net ajax or jquery. The service is free and does not require any registration and can be used for both commercial and non-commercial purposes.

ASP.net 4.0 will be especially handy for asp.net Web forms developers to take advantage of the CDN. By setting a property of the ScriptManager control, you will be able to move all requests for the built-in asp.net JavaScript file to the CDN to gain the performance of your Web Forms application.

Introduction to CDN (http://baike.baidu.com/view/21895.htm):

The full name of CDN is content Delivery network, that is, contents distribution network. The goal is to add a new layer of network architecture to the existing Internet, publish the content of the Web site to the nearest user's network "edge", so that users can get the required content, solve the Internet congestion situation, improve user access to the Web site response speed. The problem of slow response of users visiting the website due to the small network bandwidth, the large amount of users ' access and the uneven distribution of the Web site are comprehensively solved from the technology. (that is, the content of a server, the average division to multiple servers, the server intelligent recognition, so that users get the nearest user to the server, improve speed.)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.