Randomize

Richard Tallent’s occasional blog

static.google.com

After playing around with ExtJs over the last few weeks, I had a thought:

  1. Frameworks like Prototype, JQuery, ExtJs, etc. are big downloads, yet many sites use them.
  2. Google has server space and bandwidth to spare.
  3. 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:

  1. Google’s bandwidth when downloading these common framework files.
  2. Downloading from Google’s domain means their browser will open a new HTTP connection (faster)
  3. 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:

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.


Share

comments powered by Disqus