Google and Yahoo JavaScript CDN

One way to speed up loading of a website is to use Content Distribution Networks (CDN) for resources that don’t update often, such as JavaScript, images, and CSS. A good CDNs for a large site can run into the thousands of dollars, fortunately for those that rely on JavaScript frameworks such as jQuery, Prototype, and YUI you can use the use Google’s and Yahoo’s broadband.

Google hosts a large number of JavaScript libraries, including jQuery, jQuery UI, Prototype, Dojo, and even YUI! Using the JavaScript libraries hosted on Google should make your page load faster. Google give you an absolute URL address for each version of the JavaScript library you are trying to use, this makes it easy to load the required scripts.

Yahoo also provides free hosting of the Yahoo! User Interface from their servers.

One theory why using Google hosting for jQuery and similar hosted JavaScript frameworks is that if many of the sites you visit use them, your browser will already have a fresh cached version ready for you. My question is, why don’t browsers come pre-installed with the commonly used versions of JavaScript libraries? Odiously, if this feature would be enabled from the top tier browsers there would also need to implement a discovery mechanism to download into a browser repository new versions of those JavaScript libraries. A code discovery, management, and repository system that I have seen work well is that provided by Maven. In Maven, you can indicate a number of online and local code repositories from which to download required dependencies.

2 Responses to “Google and Yahoo JavaScript CDN”

  • machbio Says:

    great blog… “Why dont Browser come with pre- installed scripts ?”.. awesome thinking.. will post in browser discussions..

  • ashish Says:

    You touched my thoughts on subject “My question is, why don’t browsers come pre-installed with the commonly used versions of JavaScript libraries? “.
    I was thinking same from past 6 months.. and thought of elaborate proposal, how this will work. Not just jscripts.. what about library of images and CSS frameworks. These days, you have 200+GB of hard drive available. If I need to put aside 2-3 GB for “compressed” jscripts, CSSs and PNGs images, how fast will be internet surfing. Now combine with mobile sites with limited bandwidth. It’s win-win for developer, user and network provider.

Leave a Reply