3 ms·
Yeah, but if you gracefully handle those failures with local fallbacks, then the CDN's downtime is a moot point.
by k3n 14y ago
Yeah, but if you gracefully handle those failures with local fallbacks, then the CDN's downtime is a moot point.
- dos1 14y agoSee the rest of the comments in this thread about why the fallback can be painfully slow if the CDN is down. I saw your previous comment about making an ajax request with an adjusted timeout, but this is not ideal for making cross domain script requests for a number of reasons. For one, CORS needs to be enabled. Another is that you now have to create a script tag and take the responseText and jam it in there. This is going to be slower than just creating a script tag and setting the src attr. If you are going to have a fallback, and that fallback may take seconds to activate if the CDN is down, why not just make the fallback your primary?
- jQueryIsAwesome 14y agoYou can easily specify how much time a CDN will have to respond as you can see in my example in another comment: http://news.ycombinator.com/item?id=5003129 http://news.ycombinator.com/item?id=5003129