Microsoft ajax CDN Domain改名為aspnetcdn

公司在China有網站,而網站內有引用jQuery,而為了節省一點點流量及加快載入速度,想必會使用Ajax CDN服務,而目前只有Microsoft及Google有提供這類Ajax Framework CDN服務,使用這類服務不錯,但只有一個技術上缺點首一個…怎麼說的缺點呢?

技術上而言,我們在引使用必須將版本資料寫死,例如,
http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4-min.js或
google.load("jquery","1.4.4");,所以當版本有更動且你想升級時,那又是一件大工程,因為你必須將所有有引用的網頁找出,然後修改它。不過現在也還好,工具都寫得很方便,可以整個資料夾、整個專案的取代,也算還OK。

另一個…缺點就是…China對Google不太友善,所以我採用China使用Microsft Ajax CDN,其他使用Google Ajax CDN,最少目前Microsoft在China還沒發生什麼會被封、會被鎖之類的事情,這是思考後所決定採用的方案。

今天要更新jQuery至1.4.4版,結果發現Microsoft Ajax CDN的Domain已經改了,這是Microsoft的說明:

ajax.microsoft.com renamed to ajax.aspnetcdn.com

The CDN used to use the microsoft.com domain name and has been changed to use the aspnetcdn.com domain name. This change was made to increase performance because when a browser referenced the microsoft.com domain it would send any cookies from that domain across the wire with each request. By renaming to a domain name other than microsoft.com performance can be increased by as much to 25%. Note ajax.microsoft.com will continue to function but ajax.aspnetcdn.com is recommended.

* Old Format: http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.4.js
* New Format: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js

據Microsft說法,改使用新aspnetcdn能提升25%的效率,怎麼好!
如果你有使用到Microsoft Ajax CDN服務,快快去修改,將ajax.microsoft.com修改或取代為「ajax.aspnetcdn.com」,一點點功夫就能讓網站更快更好些,何樂而不為!

此外,Visual Studio的jQuery說明檔-vsdoc.js,從1.4.1~1.4.4都已經上線,Visual Stdio 2010引用一下,馬上就能查詢最新功能相關資訊。

參考:

Microsoft Ajax content delivery network (CDN)

沒有留言:

張貼留言

感謝您的留言,如果我的文章你喜歡或對你有幫助,按個「讚」或「分享」它,我會很高興的。