【发布时间】:2015-04-27 11:21:30
【问题描述】:
在以前的版本中,所有这些设置都可以使用如下代码在 Web.Config 文件中添加和调整:
<staticContent>
<mimeMap fileExtension=".webp" mimeType="image/webp" />
<!-- Caching -->
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="96:00:00" />
</staticContent>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
但是,随着 Web.Config 不再存在于 ASP.NET vNext 中,您如何调整这样的设置?我已经搜索了 net 和 ASP.NET Github 存储库,但没有发现任何东西 - 有什么想法吗?
【问题讨论】:
-
如果您在 IIS 上托管您的网站,您仍然可以使用 web.config 文件
标签: asp.net asp.net-mvc caching compression asp.net-core