【发布时间】:2008-11-18 01:48:13
【问题描述】:
我正在查看许多页面关于 asp.net 的性能建议。特别是删除未使用的 httpmodules 部分:
<httpModules>
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
<add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
<add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/>
<add name="RoleManager" type="System.Web.Security.RoleManagerModule"/>
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
<add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/>
<add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule"/>
<add name="Profile" type="System.Web.Profile.ProfileModule"/>
<add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</httpModules>
这里列出了一堆 HTTP 模块,我很肯定并非所有这些模块都被您的应用程序使用。删除未使用的 HTTP 模块肯定会带来轻微的性能提升,因为需要执行的工作会更少。假设在应用程序中不需要 Windows 身份验证。要删除继承的设置,请在 web.config 应用程序的 httpModules 部分下添加一个删除元素并指定不需要的模块的名称。 示例:
<httpModules>
<remove name="WindowsAuthentication" />
</httpModules>
有没有人知道在哪里有每个功能的描述,有些很明显但不是全部,我在谷歌上搜索了很长时间。
【问题讨论】:
标签: asp.net performance