Almost every site I create nowadays relies heavily on JavaScript. Having to load in all those scripts can really bog your web server down. Instead of serving those static files yourself, why not use Google? It provides a free service called Google AJAX Libraries that hosts all of the popular JavaScript libraries.
Google makes this very easy by providing a dead-simple API.
Here’s a quick example of how to load jQuery 1.3.2:
<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1.3.2");</script>
If you don’t want to use Google’s loader, they provide a direct link to the script for each library.
Using this service in parallel with Amazon S3, my Bluehost-hosted site now runs significantly faster at almost no additional cost.
Leave a Reply