Hacker News new | ask | show | jobs
by tangue 3296 days ago
Websites using cdns should always use a server hosted backup, it's not that hard

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script>
  if (typeof jQuery == 'undefined')
  {
     document.write(unescape("%3Cscript src='/serverHostedJquery.js' %3E%3C/script%3E"));
  }
  </script>
2 comments

Is not it better to serve scripts from your server? It gives you more control and you don't have to share your visitors data with Google. With external hosting you get more downtime, and in some countries Google servers are blocked so you get less visitors.
It's annoying to test though. You'd be better self hosting everything and putting a CDN in front of your site.