4 ms·
Many sites already use Google's hosted javascript libraries for JQuery, Prototype, etc... Could Google reduce load time in Chrome by building these into the br
by andrenotgiant 13y ago
Many sites already use Google's hosted javascript libraries for JQuery, Prototype, etc...
Could Google reduce load time in Chrome by building these into the browser, so that anytime they see the include pointing to Google CDN, they just skip it and let the pre-included library take its place?
- tannerc 13y agoGreat idea, why limit it to just Chrome? Of course, implementing something like this would require a number of additional updates. And this still doesn't directly address the issue due to custom, large scripts for site-specific functionality.
- carlosdp 13y agoThis shouldn't be necessary. Google's CDN (afaik) sets proper cache headers so that the first time you download a specific version of a library, your browser should cache it until it expires. (correct me if I am wrong)
- joshuak 13y agoI like this in principle. I think it should be abstracted out to a simple package system or something though. When you go to a sight that requires JQuery, your browser checks the sha256 hash or something against it's canonical list of published packages. If one is available it installs that one, or uses the one already installed. If the sha hash doesn't match it goes ahead and downloads the one from the site. However, is transfer time really the biggest issue here?
- tnuc 13y agoThe number and versions of these libraries is just immense. A lot of what the early versions of these libraries used to do is now handled by upgraded versions of javascript. Adding JQuery etc. to the browser is a short term fix, that would become a problem further down the track.
- andrenotgiant 13y agoI agree about the short term fix thing. What I meant was, "_Would_ it actually save any time to do this." not "They should do it." I am curious if there would be any speed gains, not just in data transfer but in javascript initialization and execution. Also, it would be an interesting "aspirational algorithm" if they only did this for the best/latest versions of these libraries, encouraging developers to stay up-to-date.
- olalonde 13y agoA non negligible downside is that it would give some libraries an "unfair advantage" which might harm innovation.