解決辦法:?
通常只需要index.html 不緩存即可,?其他文件都是根據(jù)index.html 中的引用去加載;
正確的做法是在 站點下增加 web.config 文件, 內容如下:
我這個是因為目錄下有個config.js 配置文件, 也不能緩存, 所以加了兩個文章來源:http://www.zghlxwxcb.cn/news/detail-800566.html
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="index.html">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="NoControl" />
</staticContent>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-store" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
<location path="config.js">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="NoControl" />
</staticContent>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="no-store" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
</configuration>
效果:?
文章來源地址http://www.zghlxwxcb.cn/news/detail-800566.html
到了這里,關于IIS 緩存, 更新后前端資源不能更新問題的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!