Search code examples
xmliisxhtmlinternet-explorer-9iis-6

Prevent XML caching in IIS 6.2


I'm running IIS6.2 on Windows Server 2012R I have .xml prevent all caching in "output caching" configured for both user-mode and kernel-mode. I have also unchecked 'enable cache' and checked 'enable kernel cache' in output cache site settings.

I also have the following in the <head> and validated the 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" />

The JS control is working 100% but the xml file is still caching, is there something I have missed?

Currently working perfectly in Chrome but if I update the .xml file it does not asynchronously refresh in Internet Explorer, I need to reload the whole page again.

Ben


Solution

  • Success by adding an extension to the file name in the JS:

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

    Happy to hear any better solutions to this problem.