Improving Javascript Load Times using Google AJAX API
If your site uses common AJAX libraries like jQuery, jQuery UI, mootools, prototype, script.aculo.us, or dojo, the first thing that you’ll notice is that these libraries are quite large and impact page load time.
For a browser with a completely empty cache, the browser will load the requested library (and block all other requests during the load). For every site the user visits, the library is loaded again and again because the cache does not work across sites. Loading site1.com/jquery.js and site2.com/jquery.js takes the same amount of time.
Google’s come up with a clever solution to this problem. Instead of pointing to your local copy of whatever AJAX library you want, you point to Google’s copy using their AJAX Libraries API.
There’s many advantages to this. If the user has been to Gmail or any Google property recently, the library is already loaded in their browser, ready to execute. If the user goes to other sites which use the API, their cache is already primed and does not need to be loaded again.
We’ve just put this in place over at Twitter, and it should improve page load times dramatically.
Add New Comment
Viewing 3 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment