방법 1: If-Modified-Since 헤더 추가
xmlhttp가 여러 번 호출되면 항상 캐시된 페이지가 표시됩니다. 명시적으로 캐시하지 않으려면 해당 http 헤더를 php 또는 asp에 추가해 보지만 효과가 없습니다!!
이제 마침내 xmlhttp.open 다음에 If-Modified-Since 헤더를 보내는 방법을 찾았습니다. 코드는 다음과 같습니다.
xmlhttp.setRequestHeader('If-Modified-Since', '0');
xmlHttp.onreadystatechange = 상태변경;
xmlHttp.open("GET", url, true);
xmlHttp.setRequestHeader('If-Modified-Since', '0');
xmlHttp.send(null);
방법 2: 요청 URL 뒤에 변경 매개변수 추가
IE는 기본적으로 동일한 URL 요청을 캐시하기 때문에 각 요청의 URL을 다르게 유지하면 IE 캐시 문제를 우회할 수 있습니다.
js: URL = "http://host/a.php"+"?"+Math.random();
vbs: URL = "http://host/a.php"&"?"&Timer()
//var url = "ResponseContentPageScore.aspx?key=" + Math.round(Math.random() * 100) + "&HotelCD=" + inputContent;
var url = "ResponseContentPageScore.aspx?key=" + new Date().getTime() + "&HotelCD=" + inputContent;