首页 > 解决方案 > 防止 IIS 6.2 中的 XML 缓存

问题描述

我在 Windows Server 2012R 上运行 IIS6.2 我有 .xml 阻止为用户模式和内核模式配置的“输出缓存”中的所有缓存。我还在输出缓存站点设置中取消选中“启用缓存”并选中“启用内核缓存”。

我也有以下内容<head>并验证了xhtml。

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />

JS 控件工作 100%,但 xml 文件仍在缓存中,我错过了什么吗?

目前在 Chrome 中运行良好,但如果我更新 .xml 文件,它不会在 Internet Explorer 中异步刷新,我需要再次重新加载整个页面。

标签: xmliisxhtmlinternet-explorer-9iis-6

解决方案


成功通过在JS中为文件名添加扩展名:

  var newFileName = "content.xml?" + new Date().getTime();
  xhttp.open("GET", newFileName, true);

很高兴听到这个问题的任何更好的解决方案。


推荐阅读