您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何禁用通过IIS提供的单页应用程序HTML文件的缓存?

如何禁用通过IIS提供的单页应用程序HTML文件的缓存?

将以下内容添加到可web.config在Chrome,IE,Firefox和Safari上运行的解决方案中:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <location path="index.html">
    <system.webServer>
      <httpProtocol>
        <customHeaders>
          <add name="Cache-Control" value="no-cache" />
        </customHeaders>
      </httpProtocol>
    </system.webServer>
  </location>

</configuration>

这将确保在请求时将Cache-Control标头设置为。no-cache``index.html

其他 2022/1/1 18:13:49 有502人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶