IIS Url Rewrite减慢了网站的速度

时间:2017-03-30 06:38:47

标签: c# asp.net visual-studio iis

我在我的web.config中使用IIS URL Rewrite 2.0来处理某些规则,因为UrlRewriting.config已过时,建议使用IIS URL Rewrite。但是,在我的web.config中添加两个简单规则后,我的网站运行速度很慢......我正在运行Sql Server Express,因此它不是数据库问题。

<system.webServer>下的web.config中保存规则后,重新加载网页(任何页面,而不仅仅是下面显示的特定网址map.xml)后,会立即出现性能下降。

任何帮助/建议?

   <rewrite>
   <rules>
    <!-- Serve site map with proper XML content type response header. -->
    <rule name="Sitemap XML" enabled="true" stopProcessing="true">
      <match url="sitemap.xml" />
      <action type="Rewrite" url="sitemap.aspx" appendQueryString="false"/>
    </rule>
    <!-- Access block rule - is used to block all requests made to a Web site if those requests do not have the host header set. This type of rule is useful when you want to prevent hacking attempts that are made by issuing HTTP requests against the IP address of the server instead of using the host name -->
    <rule name="Fail bad requests">
      <match url=".*"/>
      <conditions>
        <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
      </conditions>
      <action type="AbortRequest" />
    </rule>
    <!-- HTTP to HTTPS Rule 
    <rule name="Redirect to https" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
      <match url="*" negate="false" />
      <conditions logicalGrouping="MatchAny">
        <add input="{HTTPS}" pattern="off" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
    </rule>-->
  </rules>
</rewrite>

0 个答案:

没有答案