How to clear XML HTTP Cache
several days ago, according to xml http in javascript in sharepoint, I wanted to get xml data from a list (see the last article Filter Lookup List in Sharepoint ), but the response data is not latest even if some source data is changed just now. today I searched in internet, fortunately I find it! just to link a random parameter behind from which URL you want to get data.
For example:
var reqstring = siteName + "/_vti_bin/owssvr.dll?CS=109&XMLDATA=1&RowLimit=0&List=" + lookupListName + "&View=" + lookupViewName;

//I have to link a random number behind the url to clear XMLHTTP cache

reqstring = reqstring + "&id=" + Math.round(Math.random()*100);

var req = new ActiveXObject("MSXML2.XMLHTTP");

req.open("GET",reqstring,false);

req.send();

actually it's very simple, isn't it?
For example:
var reqstring = siteName + "/_vti_bin/owssvr.dll?CS=109&XMLDATA=1&RowLimit=0&List=" + lookupListName + "&View=" + lookupViewName; 
//I have to link a random number behind the url to clear XMLHTTP cache
reqstring = reqstring + "&id=" + Math.round(Math.random()*100); 
var req = new ActiveXObject("MSXML2.XMLHTTP"); 
req.open("GET",reqstring,false); 
req.send();

actually it's very simple, isn't it?

浙公网安备 33010602011771号