With the Google I/O developer event kicking off in San Francisco, announcements from Google are coming thick and fast. The two interesting ones for the day are the release of Ajax Libraries API and the scheduled release of GWT 1.5.
Dion Almaer from Google explains “Whenever I wrote an application that uses one of these frameworks, I would picture a user accessing my application, having 33 copies of prototype.js, and yet downloading yet another one from my site. It would make me squirm. What a waste!…”
What if we hosted these files? Everyone would see some instant benefits:
1) Caching can be done correctly, and once, by us… and developers have to do nothing
2) Gzip works
3) We can serve minified versions
4) The files are hosted by Google which has a distributed CDN at various points around the world, so the files are “close” to the user
5) The servers are fast
6) By using the same URLs, if a critical mass of applications use the Google infrastructure, when someone comes to your application the file may already be loaded!
7) A subtle performance (and security) issue revolves around the headers that you send up and down. Since you are using a special domain (NOTE: not google.com!), no cookies or other verbose headers will be sent up, saving precious bytes.
Yahoo has been providing free hosting for its impressive Yahoo UI Ajax framework for quite some time. Visit http://developer.yahoo.com/yui/articles/hosting/ for details.