-1

I created CDN links for my project... Some people says the drawback about CDN links the company update the links when have new versions come.. Is it true...I wont to stay in my given version(not need update).. They delete my given CDN Link and replace new version.. It can be affect to my project... I cannot add it to my server because webpage load time is increase.... Please give me an idea about CDN links.

I use these links

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.11.1.js"></script>

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/tabletools/2.2.4/css/dataTables.tableTools.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.16/datatables.min.css"/> 
<script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/tabletools/2.2.4/js/dataTables.tableTools.min.js"></script>
Nipun Vidarshana
  • 451
  • 1
  • 5
  • 12

1 Answers1

1

You never know for certain what a CDN will do, but generally the good ones are relatively stable. When a new version of a CDN-hosted file is released, it is hosted using that version number in the URL -- so sticking with an old version won't break your page, even when a new version is released.

CDNs will typically still host older versions of software. As an example, BootstrapCDN.com/legacy/ lists older versions of Bootstrap that are still available, and still hosted by version number, all the way back to v2.0.4.

Legacy versions of jQuery are also still hosted; you can see the versions and links at code.jQuery.com/jQuery/.

If you want a backup plan in case a CDN stops hosting a version that you need, you can use a little JavaScript to link to a backup copy, if the first link doesn't work for some reason. This Stack Overflow answer shows you how to do that.

freginold
  • 3,946
  • 3
  • 13
  • 28
  • Thank you. I use that methord for the JS ...But It cannot add to the css stylesheets – Nipun Vidarshana Nov 19 '17 at 03:48
  • For CSS, you could check for `.getComputedStyle`... if a style hasn't been applied (i.e. a known Bootstrap style) then you could use JS to load that stylesheet from somewhere else; either locally or another CDN. – freginold Nov 20 '17 at 11:20