When using JavaScript libraries to perform a function on a public-facing web site, the traditional way of referencing your library is using something like this:
<script src="/js/jQuery.min.js" type="text/javascript"></script>
Here, we are loading a jQuery library in to the HTML header for future use on the web page. This means each time you want to use the jQuery library (or any other JavaScript library) on your new web site, you must download the latest version, upload it to your server, and then reference it here. This technique works well enough, but lets explore a better way to perform this same library load. We’ll do it in a way which will help us with version control, decreased latency, and better caching. How? By utilizing a CDN (content delivery network).
Below is an example on how to go about using the Google AJAX Libraries CDN, using jQuery as the library to load.
<script src="http://www.google.com/jsapi?key=apikey" type="text/javascript"></script>
<script type="text/javascript">
google.load("jquery", "1.4.1");
</script>
With this bit of code we’re loading in the CDN hosted library by using “google.load”, after specifying our unique site API key. Don’t have one? Go here to get yours now. They’re FREE. Then, we tell google.load to grab the library and version number. That’s it. Of course, many other libraries are available, and can be found here.
How does using a CDN like this benefit you and your web visitors, exactly?
1. Version control: No more guessing what version of jQuery or Google Maps or SWFObject you are using. The version number is right there. In addition, you can specify the latest major release version by using the syntax google.load(”jquery”, “1″), which will pull in the latest “1″ there is available on the CDN. When jQuery releases version 2.0, then you’ll need to change this to “2″, and so on.
2. Decreased latency: Since the CDN is distributed all over the globe, visitors arriving at your web pages will be directed to download from the closest CDN node available, increasing speed-to-content.
3. Better caching: If your visitor has already cached this version of jQuery from another web page, they won’t even need to download it. Instant-ON! The browser will understand that this file request is already in the cache, and will use it.
It may be time to switch over, and begin to use the Google AJAX Libraries CDN to serve jQuery and other libraries to your users directly from Google’s network of datacenters.
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.

Original Source: