



此操作会修改Web.Config
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
</configuration>

以上可见,不会有缓存,刷新都会重新加载。

<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="2.00:00:00" />
</staticContent>
</system.webServer>
</configuration>

以上操作,除了首次加载和动态页面,那么其他的就会走缓存,此处可以控制缓存的时间。

本文介绍了如何通过修改Web.Config文件来设置IIS服务器上的静态内容缓存策略,包括禁用缓存和设置最大缓存时间。
850

被折叠的 条评论
为什么被折叠?



