2

在阅读 asp.net cdn 站点时,我阅读了以下内容

使用 ASP.NET 4 时,您可以将所有对 ASP.NET 框架脚本的请求重定向到 CDN。从 CDN 而不是本地 Web 服务器检索脚本可以显着提高公共 ASP.NET 网站的性能。

使用 ScriptManager EnableCDN 属性将所有 ASP.NET 框架脚本请求重定向到 Microsoft Ajax CDN:

<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" Runat="Server" />

这是否意味着在模板 asp.net 网站上,在母版页上创建的脚本管理器被删除,包括它下面的脚本?

例如,我们是否要删除它?

<asp:ScriptManager runat="server" >
    <Scripts>
        <%--Framework scripts--%>
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="jquery" />
        <asp:ScriptReference Name="jquery.ui.combined" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site scripts--%>
    </Scripts>
</asp:ScriptManager>

并将其替换为;

<asp:ScriptManager ID="ScriptManager1" EnableCdn="true" Runat="Server" />

该 CDN 现在会交付我们请求的所有文件,包括 jquery 及其子集和 ajax 控制工具包文件吗?

4

0 回答 0