【发布时间】:2013-07-06 02:38:52
【问题描述】:
我阅读了许多关于使用 CDN 托管 jQuery 的 MVC 博客。他们都说 “在上面的代码中,将在发布模式下从 CDN 请求 jQuery,并且在调试模式下将在本地获取 jQuery 的调试版本。” (例如http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification)
但是,当我编写这段代码时:
// Enable CDN support
bundles.UseCdn = true;
//add link to jquery on the CDN
const string jqueryCdnPath = "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";
bundles.Add(new ScriptBundle("~/bundles/jquery",jqueryCdnPath)
.Include("~/Scripts/jquery-{version}.js"));
...并调试我的 MVC 应用程序,正在调用 google api(不是我在调试时所期望的本地副本。
我的构建肯定是调试的,在我的 Web.config 中,我有这个:
<compilation debug="true" targetFramework="4.0">
有谁知道为什么仍在进行调用以从 google CDN 获取 jquery?
【问题讨论】:
标签: asp.net-mvc debugging query-optimization cdn