
What if I told you that you could harness Google’s servers to load Jquery, Mootools, Scriptaculous or even Prototype on your blog? There are hundreds of servers spread throughout the world dedicated to loading your JavaScript that much faster. Google recently launched the “Google AJAX Libraries API” which allows you to use Google’s CDN to load popular JavaScript frameworks, many of which are in use by web developers today.
Every blog will use a JavaScript framework to “spice” up their blog with animation and usability (I happen to use Jquery). The only down side of using these libraries is the 50KB+ download that it takes up to deliver the framework to each visitor. Not only does loading a large JS file block parallel downloads, it won’t start loading other content until it is completely finished. However, Google’s free CDN eliminates this problem and allows you to use their cacheable libraries on your blog.
How to Harness Google’s AJAX Libraries API and CDN:
First, you need to call Google’s JSAPI file to allow Google to serve the right files on your blog:
<script src="http://www.google.com/jsapi"></script>
Now you are able to load any supported javascript library through Google:
<script> // Load jQuery google.load("jquery", "1.4.1");
</script>
You’re now serving the latest version of Jquery on your blog using Google’s Free CDN. Another benefit of using this CDN is the cacheable aspect of it – If a user has a cached version of Google’s Jquery, they won’t even have to re-download it when they visit your blog!
Save Money:
You save 50KB+ per visitor in bandwidth by outsourcing it to Google.
Save Time:
Well, technically it isn’t your time, but rather the visitors’. That just means they can read your articles quicker and convert into a fulltime reader! ![]()
















9 Comments
Thanks for the tip, Brad. I wasn’t aware of the google ajax libs.
Btw, “when they visitor” should be “when they visit”.
Artem Russakovskii´s last blog ..Wordpress Developers – How Do You Make A Living [Poll + Discussion]?
Opps. Thanks Artem.
Long time did not optimize my blog already. Does this speed up a lot?
Jayce´s last blog ..How to install Garmin Mobile XT for Windows Mobile Phone?
It speeds it up as the visitor doesn’t have to download the Jquery.
Thanks for the speed up tip this looks great.
steve´s last blog ..Search Shared File Servers
Very cool, I didn’t know that this was possible. 50kb usually downloads quickly for most users, but every second saved is a good thing. Thanks for this.
Josh´s last blog ..Toronto Movers
50KB saved is better than serving the same file an additional time
Glad you liked the tip.
Indeed these chached javascripts are better choice because most of the users on the web will have that version of javascript already. This definitely speeds up things. Another good way to speed up things is by caching up everything from the webserver.
Caching Images, JS and CSS is an excellent way to make any blog or website fast loading.