文章内容

2017/3/2 13:10:30,作 者: 黄兵

Asp.Net MVC4 Bundle捆绑压缩技术

使用CDN

bundles.UseCdn = true; //使用CDN
string jqueryCdn = "http://code.jQuery.com/jquery-1.7.1.min.js";
bundles.Add(new ScriptBundle("~/bundles/jquery", jqueryCdn).Include(
                        "~/Scripts/jquery-{version}.js"));

当cdn服务器挂了或不能访问了,这里就会选择本地的资源文件,debug下mvc 会让我们看到他原来的面具,这点非常好利于我们调试。  


   

分享到:

发表评论

评论列表