Two solutions for XMLHTTP cache cleaning


**Method 1: add an if-modified-since header **XMLHTTP always displays a cached page when it is called many times, and it doesn’t work to try to add the corresponding HTTP header to PHP or asp to explicitly not cache!!

Now you’ve finally found a way to send an if-modified-since header after xmlhttp.open, as shown below XMLHTTP. SetRequestHeader (’ the if-modified-since ’, ‘0’); XmlHttp. Onreadystatechange = stateChanged;                       XmlHttp. Open (” GET ”, url, true);                       XmlHttp. SetRequestHeader (’ the if-modified-since ’, ‘0’);                       XmlHttp. Send (null);

Method 2: request URL followed by a change parameter

Because IE will cache the same URL request by default, so the URL plus the unique parameters as a distinction, keep the URL of each request is different, you can bypass the problem of IE cache           Js:         URL = “http://host/a.php” + ”?” + Math. The random ();           VBS:     URL = “http://host/a.php” & ”?” & the Timer ()

  / / var url = “ResponseContentPageScore. Aspx? Key =” + math.round (math.random () * 100) + “&HotelCD=” + inputContent;   Var url = “ResponseContentPageScore. Aspx? Key =” + new Date(). GetTime () + “&HotelCD=” + inputContent;