8
Some people recommend using the following technique (fallback) to load Javascript libraries locally if the CDN is out of order:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="jquery.js"><\/script>')</script>
My question is: If the CDN is really off the air, the browser will not take several seconds to consider timeout and upload the local version? This would slow down the navigation as every page change it would try again.
Besides, the big bet when using CDN is that the file already exists in cache in the browser, so downtime may not even be noticed.
– bfavaretto
the 2nd script can point to another CDN tbm
<script>window.jQuery || document.write('<script src="//outro.cdn.com/jquery.js"><\/script>')</script>
– neoprofit