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. (more…)







