Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ajax.microsoft.com vs cookieless domain for cdn

Tags:

http

cdn

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?

like image 958
dotneter Avatar asked May 15 '10 02:05

dotneter


2 Answers

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.

like image 176
Matti Virkkunen Avatar answered Sep 25 '22 18:09

Matti Virkkunen


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

like image 37
weir Avatar answered Sep 25 '22 18:09

weir