[whatwg] Browser Bundled Javascript Repository

Ian Hickson ian at hixie.ch
Sun Jul 12 20:58:12 PDT 2009

On Mon, 15 Jun 2009, Joseph Pecoraro wrote:
> A while back I came across this two paragraph blog post titled "Browsers
> Should Bundle JS Libraries:"
> http://fukamachi.org/wp/2009/03/30/browsers-should-bundle-js-libraries/
> The premise is basically that browsers are repeatedly downloading the same
> javascript frameworks from different domains over and over every day.  In the
> author's own words:
> "All popular, stable Javascript libraries, all open source. All downloaded
> tens of millions of times a day, identical code each time."
> Below is a summary and expansion of my comments/ideas from the discussion on
> the above blog article.
> A typical solution to the problem, and one that works right now in browsers,
> is that if you require a javascript library on your website you can point to a
> "publicly available" version of that library.  If enough sites use this public
> URI then the browser will continually be using that URI and it will be cached
> and reused by the browser.  This is the idea behind Google's Hosted Libraries:
> http://code.google.com/apis/ajaxlibs/
> There are some arguments against using Google's Hosted Libraries:
> http://www.derekallard.com/blog/post/jquery-hosted-on-google-and-some-implications-for-developers/
> However, I think the author makes a good point. Bundling the JS 
> Libraries in the Browser seems like it would require very little space, 
> could even be stored in a more efficient representation (compiled 
> bytecode for example), and would prevent an extra HTTP Request.  The 
> problem then becomes how does a browser know example.com's jquery.js is 
> the same as other.com's jquery.js. The developer should opt-in to 
> telling the browser it wants to use a certain JS Library version that 
> the browser may already know about.
> The way I thought about it was by adding an attribute to the <script> 
> tag.

I would recommend approaching the browser vendors directly and seeing if 
they would be interested in implementing this idea, as discussed in this 
FAQ entry on introducing new features:


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list