Speed up your javascript - run Prototype / JQuery from Google
Posted by: john in Speed Up NZ Internet, TechnologyGoogle 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 !



