I am using a script bundle in an MVC application to load a script from CDN using the code below:
bundles.Add(new ScriptBundle("~/bundles/jqueryValidate", "//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js").Include("~/Scripts/jquery.validate.min.js"));
If the CDN fails it should load the script from the local repository (from inside the project).
I have added:
bundles.UseCdn = true;
and
BundleTable.EnableOptimizations = true;
to make sure the CDN is loaded first.
When I try from my network (public network) it works just fine: the script loads from the CDN without any issues.
If I try from my client's network (corporate network) the CDN is blocked and the replacement script is not loaded. I don't understand why the failover mechanism that I put in place was not working.
Do you know why that might happen?