How to load local files if CDN is not working How to load local files if CDN is not working asp.net asp.net

How to load local files if CDN is not working


You can use this scripts below:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><script>    window.jQuery || document.write('<script src="/scripts/jquery.1.9.1.min.js"><\/script>')</script><script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script><script>    window.jQuery.ui || document.write('<script src="/scripts/jquery-ui.min.js"><\/script>')</script>

Hope usefull!


This is achievable through DNS setting without changing code.

Basically you are trying to do failover between CDN and your origin server. If CDN fails, the request fails over to your origin server. One option is to use DNS level failover with primary to CDN CNAME, backup to your origin server hostname.

And you also include healthcheck in your DNS setup for both CDN and origin server. Once healthcheck fails for CDN, DNS should fail over to your origin server and serve static file from there automatically.