I have an caching problem every time I do simple CORS get request on IE. This is not happening on Chrome. So i had to add options on get request:
let options = new RequestOptions({
url: this.elementsUrl,
method: RequestMethod.Get,
headers: this.getHeaders
});
return this.http.get(this.elementsUrl, options)
.map(response => response.json())
.catch(error => {
console.error('Error', error);
return Promise.reject(error.message || error);
}
);
And I set headers to disable cache.
private _getHeaders = new Headers({
'If-Modified-Since': 'Mon, 26 Jul 1997 05:00:00 GMT',
'Cache-Control': 'no-cache',
'Pragma': 'no-cache'
});
And now I am getting info required CORS preflight and XMLHttpRequest: Network Error 0x80070005, Access is denied. Can I avoid triggering preflight options? Am I setting options correctly?
It's only related to IE that do caching of GET request. CORS is working OK on chrome. On server side is set: Access-Control-Allow-Origin: *