Google Offering (Cachable) AJAX Library Hosting

Looks like Google has announced that they will be providing hosting for the following 5 (most popular) AJAX Libraries:

in the form of their AJAX Libraries API project, described as:

Google works directly with the key stake holders for each library effort and accept the latest stable versions as they are released. Once we host a release of a given library, we are committed to hosting that release indefinitely.

The AJAX Libraries API takes the pain out of developing mashups in JavaScript while using a collection of libraries. We take the pain out of hosting the libraries, correctly setting cache headers, staying up to date with the most recent bug fixes, etc.

The reason for this service existing is because of how JavaScript files are cached: on a per-URL basis. So if you visit 10 sites, that all use prototype (e.g. prototype.js) the load URL for that JS file is different for every single site:

  • http://mysite.com/scripts/prototype.js
  • http://www.amazon.com/scripts/prototype.js
  • http://blogs.superblogs.com/prototype.js
  • etc.

So the actual prototype.js file is loaded all 10 times and included in the page-load time. If the URL for that JS file was the same for every site, in this case, using the Google AJAX Libraries API, then that prototype.js file would be loaded once, and reused with all the other 9 pages.

Naturally this improvement in site load time only occurs is most of the sites you visit are using the AJAX Libraries API to host their AJAX libraries from, otherwise downloading all the AJAX libraries from the individual site will still be occurring for you.

And interesting step in a direction… this does give Google an awful lot of usage data from different apps around the world calling into their API, effectively reporting technology/site/pageview statistics indirectly.

Thanks OSTATIC!

Tags: , ,

About Riyad Kalla

Software development, video games, writing, reading and anything shiny. I ultimately just want to provide a resource that helps people and if I can't do that, then at least make them laugh.

, ,

No comments yet.

Leave a Reply


5 − 2 =