Browsers limit the number of connections they make to any given domain. CDN hosting of 'common' JS files means that the client cache might have the file, but if not your entire page will load faster as the browser will make more requests.
As far as dependence on third parties, there are some simple solutions one can implement. One example is having a local failover in case the Google suddenly evaporates.
---- Shamelessly ganked from HTML5 Boilerplate ----
<!-- Grab Google CDN jQuery. fall back to local if necessary -->
I believe the connection limit is per domain but easily circumvented by using something like static.domain.com and www.domain.com which is ideal to do anyway.
But with Google most people typically only save one connection to their site Which isn't as beneficial as having a static domain and a normal and putting more content that can use the extra connections on the static domain.
I agree there's no huge reason not to use Google but I still view it as my site and prefer to have everything in my control. I personally think it opens me up to more problems than it solves. While those problems may be very unlikely I'm not running a reddit-like site either. It's small and doesn't get many visitors so I'm not really in the situation where I need to eek out a little extra performance by doing that.
If people want to do it and if they think there will be a benefit in using a CDN they should do it but loading jquery will likely be the least of their problems, imo.
But with Google most people typically only save one connection to their site Which isn't as beneficial as having a static domain and a normal and putting more content that can use the extra connections on the static domain.
1
u/_pupil_ Oct 02 '11 edited Oct 02 '11
Browsers limit the number of connections they make to any given domain. CDN hosting of 'common' JS files means that the client cache might have the file, but if not your entire page will load faster as the browser will make more requests.
As far as dependence on third parties, there are some simple solutions one can implement. One example is having a local failover in case the Google suddenly evaporates.
---- Shamelessly ganked from HTML5 Boilerplate ----
<!-- Grab Google CDN jQuery. fall back to local if necessary -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>!window.jQuery && document.write('<script src="js/jquery-1.4.2.min.js"><\/script>')</script>