I´m trying to add some CDN capable bundle with ASP.NET MVC 4. The purpose is to share content locally by many other sites hosted in the same data center
The first attempt was:
bundles.Add(new ScriptBundle("~/bundles/jquery", "http://mysite/Content/js/").Include(
"http://mycdnsite/Content/js/jquery.unobtrusive-ajax.min.js",
"http://mycdnsite/Content/js/jquery-migrate-1.2.1.js",
"http://mycdnsite/Content/js/jquery-{version}.js"));
Unfortunatelly, this is not possible, because the virtualPaths must be relative (Only application relative URLs (~/url) are allowed)
Then I´ve tried this:
bundles.Add(new ScriptBundle("~/bundles/jquery", "http://mycdnsite/Content/js/").Include(
"~/jquery.unobtrusive-ajax.min.js",
"~/jquery-migrate-1.2.1.js",
"~/jquery-{version}.js"));
But it hasn't worked, even enabling CDN:
BundleTable.EnableOptimizations = true;
bundles.UseCdn = true;
Is it possible to create a multiple content bundle with CDN?