4 ms·
Why not use Google's CDN? https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.m...
by ihsw 12y ago
Why not use Google's CDN?
https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.m...
- Zikes 12y agoBecause you'd still be putting your web site in someone else's hands. http://www.sslshopper.com/article-ssl-certificate-renewal-even-google-forgets.html http://www.sslshopper.com/article-ssl-certificate-renewal-ev...
- StoryboardThat 12y agoGoogle doesn't host jquery migrate
- donpdonp 12y agoOr for that matter, why not use any of the other CDNs that host jQuery? http://cdnjs.com/ http://cdnjs.com/ http://www.jsdelivr.com/ http://www.jsdelivr.com/ http://www.asp.net/ajaxlibrary/cdn.ashx http://www.asp.net/ajaxlibrary/cdn.ashx
- fourstar 12y agoBecause not everyone requires jQuery with a script tag. Especially with require/common.js.
- danielweber 12y agoI am some kind of weird mutant because I consider having external javascript on my website to be an embarrassment for anything bigger than a hobby project -- but 99% of the universe behaves otherwise.
- UnoriginalGuy 12y agoThat's because the other 99% understands how browser caching works. If you use JQuery.com, Google, or Microsoft's CDNs then MOST of the time users won't have to download a JQuery/Boostrap/etc library as the browser would already have an unexpired cache of it. For example, the OP's link's cache will expire (theoretically) in the year 2079. So if a user visited ANY page that utilises JQuery v1.10.2 they already have it. That is a HUGE win. It is an even huger win for mobile (e.g. for small sites you could cut your network traffic in half, which in turn increases loading speed). It is also trivial to set it up so the page tries the CDN first and if that fails then grab a local copy e.g. <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script>window.jQuery || document.write('<script src="lib/jquery-1.10.2.js">\x3C/script>')</script>
- dm2 12y agoWould just using another CDN be just as safe?
- r1ch 12y agoSome users block the big CDNs for privacy reasons, so local is a safe fallback.
- UnoriginalGuy 12y agoNo, no particular reasons. It is just the safest fallback. Presumably if a user is even able to run that script (since you yourself are hosting it) the library would also be available (i.e. either both are down or neither).
- nilved 12y agoI fully understand how browser caching works, which is why I know that making the first request to my website immeasurably faster is not worth betraying my user's privacy and my website's stability. At the very least, everybody using CDN-hosted jQuery should also have a fallback copy.