开发者

ajax.microsoft.com vs cookieless domain for cdn

开发者 https://www.devze.com 2022-12-30 03:53 出处:网络
If I\'m开发者_如何学运维 right, each request for http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js

If I'm开发者_如何学运维 right, each request for http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js uses something like 3kb of microsoft.com cookies. Do I not understand something and it doesn't matter or is Microsoft wrong?


It's because there's a whole bunch of cookies set for the microsoft.com domain, which will naturally also be sent to requests to its subdomains as well. Microsoft is doing it wrong.

Google, on the other hand, uses a separate domain (googleapis.com) for its CDN, for which at least I have exactly zero cookies. I suggest you use Google's CDN instead.


You are right and Microsoft solved this eventually by creating ajax.aspnetcdn.com:

http://www.asp.net/ajaxlibrary/cdn.ashx#ajaxmicrosoftcom_renamed_to_ajaxaspnetcdncom_15

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.8.0.js New Format: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js

0

精彩评论

暂无评论...
验证码 换一张
取 消