After playing around with ExtJs over the last few weeks, I had a thought:
- Frameworks like Prototype, JQuery, ExtJs, etc. are big downloads, yet many sites use them.
- Google has server space and bandwidth to spare.
- Google has a strong interest in supporting web-based applications.
I think it’d be spiffy if Google hosted a few FOSS Javascript, CSS, and image resources, and encouraged all web designers to link to them rather than hosting the files themselves.
Users would see three immediate benefits:
- Google’s bandwidth when downloading these common framework files.
- Downloading from Google’s domain means their browser will open a new HTTP connection (faster)
- The user’s browser cache would already have these popular files when they visit future sites that use them.
On Google’s side, it’s dirt-simple: static files, one folder for each version. So, a web designer wishing to use the current version of Prototype would simply add a link to “http://static.google.com/prototype/1.5.1.1/prototype.js”. If Google wanted to get fancy and allow for more HTTP connections, they could add more domains, such as “prototype.static.google.com.”
Because versioning is done in the URI, Google could set the expiration headers so the user’s browser would keep the file cached forever, diminishing the bandwidth cost even further.
I’ll even recommend some starter content:
- Prototype
- JQuery
- Scriptaculous
- Ext JS
- “Silk” icons (http://www.famfamfam.com/lab/icons/silk/)
- TinyMCE
I don’t recommend that Google open this up to just anyone to post random files for hosting–we know where that will lead. But these packages (and a few others I can’t think of right now) have a large fan base and are incredible tools for creating web applications, and only a company like Google could pull this off.
I’m trying to remember if any XSS limitations would be an issue, but if so, a web designer could fix that with a simple CNAME.
Update: I’m not the first to think this, apparently. Dean Edwards played around with making code.google.com serve up some static content, and the comments there confirm that others think this would be a great idea. So what about it, Google? Can you spare some change?
Update 2: Someone is using Google Code to try to do this. We’ll see how long it takes for Google to either shut it down or sign on. I disagree with their philosophy of only distinguishing major and first-level minor releases. Even small releases can introduce issues, and it should be up to the site designer to flip the switch or to even use beta versions along the way.
That would lead to even more control/surveillance by Google. I would rather like an option to store/use that stuff locally (Browser folder). That would be no waiting for another server and full control.
I really like this idea. For Javascript you’d want to add a bunch of other libraries too, starting with MochiKit.
The only downside I can see for Google is that it takes attention away from their own AJAX libraries, but I think the upsides you mention are easily worth it for them.
For the content providers there’s the question of letting Google track every visit to your site, but most people are fine with that anyway (AdSense). I would imagine Google might want to require some JS play or other trick to register and track every hit, but hopefully they’d talk themselves out of it and realize their big upside is increasing the reach of Web 2.0 apps in general (iPhone).
Google is increasingly acting as the foundation of the web, and static.google.com would push it in that direction, which can only be good for Google (and bad for Yahoo, so Yahoo starts the same thing, competition is good, the consumer wins).
It’s a great idea, especially the cache thing, I know of a way to use Google’s servers to host files but it’s limited and it’s subject to quite a small bandwidth limit.
And of course Yahoo! already do this with their own YUI…
This is a great idea… Yahoo also has something like this in place, but alas, only for their YUI! JavaScript library. You can read more about how Yahoo hosts their YUI! library here: http://developer.yahoo.com/yui/articles/hosting/
If Google does implement something like this it would be great if it is tied down and available to all developer of open source projects that use Google’s project hosting, http://code.google.com/hosting/.
That is a great idea! I hope someone from google is reading this
Google potrebbe hostare alcuni frameworks Javascript nei proprio server?…
Era un’idea che mi ballonzolava in testa da molto tempo (non sono l’unico) ossia sperare che Google renda pubblici nei propri servers i frameworks Javascript più famosi in modo che ogni sviluppatore possa farne riferimento ogni volta che ne ha bisog…
I like the idea, but i have a doubt here…
Can the AJAX functionality of these libraries still be used, coz, i understand that an AJAX call has to be made to the same server as the js file originated from… or am i missing something?
[...] year, I asked them to consider hosting AJAX libraries (so users benefit from multiple HTTP connections and strong [...]
Now that Google have implemented this, is anyone using it?
Gil, I am!
At my job, we have several apps dependent on Prototype and Scriptaculous, so I swapped them from my own static-file server to Google.
I also switched to CacheFile for Ext Js, but it’s a little slow for my tastes, I may switch back until someone with a better CDN picks it up.