我正尝试加入一些CDN能够捆绑与ASP.NET MVC 4的目的是通过在同一个数据中心ASP.NET MVC多个virtualpath捆绑与CDN
举办了许多其他网站的本地共享内容第一次尝试是:
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"));
可惜的是,这是不可能的,因为virtualPaths必须是相对于 (仅应用相对URL(〜/ URL)被允许)
然后从来就试过这样:
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"));
但一直没有工作,甚至使CDN:
BundleTable.EnableOptimizations = true;
bundles.UseCdn = true;
是否有可能创建一个CDN多个内容包?
这工作正常,当我添加一个虚拟路径。我想要做的是将map〜/ bundles/jquery映射到许多虚拟路径... – MarcosRP