runAllManagedModulesForAllRequests 一般设置为false,当为true时所有的资源将进入mvc处理,无疑会给服务器加大压力。
解决办法是时使用HtmlFileHandler
HtmlFileHandler 的 path 可以为“*.html” 表示所有的html后缀都将进入mvc处理
 
<configuration>
    <system.webServer>
  <!---->
      <modules runAllManagedModulesForAllRequests="false"/>
  <!--请求 允许某个后缀名请求进入处理 避免使用runAllManagedModulesForAllRequests="true" -->
      <add name="HtmlFileHandler" path="page.html" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </system.webServer> 
</configuration>
 
 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-08-22
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-26
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-08-27
  • 2022-12-23
相关资源
相似解决方案