Why bother with an API for google's CDN
http://code.google.com/apis/libraries/devguide.html states that you need to sign up for an API to use the CDN. But why? You can clearly use it without.
Doesn't linking to google.com/blah/jquery.js?myAPIcode mean that a new version of jquery.js would be downloaded, rather than u开发者_如何学Gosing a cached version? So using an API would slow down my website, and not using one would speed it up? Is there any advantage of using an API? Or is it just so Google can "contact you directly if we detect an issue with your site" AKA track you?
It says here a direct link is actually fastest:
"The preferred method is to load the libraries via standard tags (as in script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">, which will result in the fastest loads. "
Here it says a few reasons for using Load is that you can get the latest version automatically or specify a language or automatically load (or not load) css files, etc.
Given the http://html5boilerplate.com/ guys don't use an API, I think it's best not to. No one seems to know of a good reason. And Google tracking your site isn't a good reason (you probably use google analytics anyway!).
精彩评论