Reproduce steps:
1, In IE 10 (and IE 11), use XMLHTTPRequest(CORS) to request a server file. The code is as follows:
var xhr=new XMLHttpRequest();
with (xhr) {
onload=function(){
// ...
}
onerror=function(){
// ...
}
open("GET","http://anotherdomain.com/ajax.asp",true);
withCredentials=true;
send(null);
2, The server file ajax.asp returns several HTTP headers and normal content:
Access-Control-Allow-Origin: http://mydomain.com
Access-Control-Allow-Credentials: true
Cache-Control: max-age=3600
3, In local internet temporary files folder, I can see the http://anotherdomain.com/ajax.asp cache file expire time is properly set to be an hour later.
4, Repeat running the code in step 1, I found every time, IE 10/11 still sent request to server anotherdomain.com to request the file ajax.asp. It seems IE totally ignores ajax.asp returns "Cache-Control: max-age=3600".
The behaviour is different with Chrome and Firefox. After the two browser receive the response ajax.asp from anotherdomain.com first time, they will not send request for subsequent same XMLHTTPRequest request. And I found the requests to ajax.asp contains a header "Cache-Control: no-cache", Chrome and Firefox don't contain the header when they request ajax.asp by XMLHTTPRequest.
So, how can I control XMLHTTPRequest(CORS) to use the local cache like normal web pages?
Thanks