xml - 防止 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 中异步刷新,我需要再次重新加载整个页面。
本
解决方案
成功通过在JS中为文件名添加扩展名:
var newFileName = "content.xml?" + new Date().getTime();
xhttp.open("GET", newFileName, true);
很高兴听到这个问题的任何更好的解决方案。
推荐阅读
- python - 用python生成关联规则后计算总价和数量
- php - 如何使用 php 在循环中制作完美的表?
- .net - Automapper 10 和 Simple Injector v5 设置“SimpleInjector.ActivationException”
- c# - 通过数据库查询并在cshtml上显示
- javascript - 使用 Google Chrome DevTools 点击页面上的“Follow”按钮
- visual-studio-code - VS 代码终端不能用作 cmd
- dynamics-365 - 使用 DMF 禁用 D365 FinOps 中的所有用户
- r - 创建用于生成特定位置图的“包装器”函数
- node.js - NodeJs + TS 不识别任何路由
- java - 为什么邮递员显示404未找到