Google Libraries API
Google Libraries API now serves common libraries like Dojo and jQuery all minified and gzipped and ready to go. Yahoo has been doing this with YUI for quite a while now and AOL with Dojo.
The idea is that if enough sites are using the centralized Google libraries then when a user arrives to your site there is a chance the library is already cached in the user's browser. This saves your server some bandwidth and means the page loads faster for the user. All engineering ideas have pros have cons.
Is minifying and gzipping common library files a burden? No because you have to do it for your page-specific files anyway.
Will the file really be cached because another site is using the file? To start, Google is offering 8 files. With URLs ending in
The above snippet also buys you forgiveness from the boss if Google shuts down the service or stops supporting a particular version that your 100 000 legacy pages use 5 years from now.
Will users notice that multiple servers are involved? Google is serving the shared files with
http:// so if your page is
https:// then users may see a "this page contains both secure and insecure items" alert. This concern may not apply too frequently but it does not help gain user trust with sharing their credit card number if that is your objective.
Have something to write? Comment on this article.