Speed up your javascript – run Prototype / JQuery from Google
Google has just released the AJAX Libraries API. Google has created an API that allows developers to access a number of popular javascript API from the Google Cloud.
You can use the Google AJAX Libraries API to reference:
- Prototype
- JQuery
- MooTools
- Scriptalous
- Dojo
Why is this good idea ?
- Its Fast – its hosted on the Google CDN.
- The libraries have already been optomised ie. minified, delivered via compression
- It enables better caching of key libraries from one site to another. ie. Visit site A that uses mootools it downloads the javascript. Visit site b that uses mootools and it fetches it from the cache.
How do I use it ?
Its really easy to use. Either call the scripts directly eg.
<script src=“http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js”></script>
or use the Google API to load them scripts.
<script src=“http://www.google.com/jsapi”></script>
// Load jQuery
google.load(“jquery”, “1”);
A couple of requests to Google
The AJAX Library API is a fantastic idea, but it could be better. We have a couple of requests 🙂 .
- can you host more of the legacy versions of the libraries. (We use an old version of prototype. The recent versions are a little bloat for what we need).
- It would great if you could provide stats on how many sites in a particular country are using the libraries. Then we can see if there are other sites in that are using the same libraries and then we get the benefit of caching 🙂
- Properly minify the scripts! Thanks for to Eric for pointing it out.
- Fix the Website. The FAQ and Groups links are going to the wrong place !
May 29th, 2008 at 3:55 am
John,
I definitely agree with your requests! If you’re interested I wrote a similar article on my site and actually did some quick performance tests, very interesting stuff! Just a note though, it doesn’t look like the libraries are minified, I think they’re just gzip compressed, so maybe there is another one to add to your list!
May 29th, 2008 at 8:35 am
Thanks Eric. I think I also need to put fix the FAQ, BLOG and Group links on the site! They all point to AJAX Feed API !