I need to download a document in background.
I use XMLHttpRequest of course... it works ok but if the doc is in the cache it loads from there and I don't wish this. I need always a fresh copy every time. How can I do this ?
Extra info:
- I don't wish to put in the URL extra arguments ( like '&' + d.getTime() ... )
- The pragma & cache-control seem to be useless...
Here's my code:
Code: Select all
XHRequest = new XMLHttpRequest();
XHRequest.onload = OnLoad;
XHRequest.onerror = OnError;
XHRequest.open( 'GET', sURL, true );
// XHRequest.setRequestHeader( 'Expires', 'Sat, 1 Jan 2005 01:00:00 GMT' );
// XHRequest.setRequestHeader( 'Last-Modified', '-1' );
XHRequest.setRequestHeader( 'Pragma', 'no-cache' );
XHRequest.setRequestHeader( 'Cache-Control', 'no-cache, must-revalidate' );
XHRequest.send( null );
I always got the cached version of the document...
Any comments is appreciated!
Bye bye,
-Mat-