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:"
> The premise is basically that browsers are repeatedly downloading the same
> author's own words:
> 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,
> "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:
> There are some arguments against using Google's Hosted Libraries:
> 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>
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