Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why bother with an API for google's CDN

Tags:

caching

cdn

api

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 using 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?

like image 283
thugsb Avatar asked Jun 14 '11 21:06

thugsb


1 Answers

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.

like image 127
Steve Wellens Avatar answered Nov 09 '22 07:11

Steve Wellens