$.ajax({
url: "https://mynas.com/myfile.json",
cache: false,
dataType: "text",
success: function (data) {
//calling this on a 5 second interval
//data does not reflect updates unless the page is refreshed
},
error: function (data) {
console.log("Bummer...");
}
});
If I make the call above at 5 second intervals I always get the data returned by the first call even if I update and save myfile.json on my server. Shouldn't setting cache false cause a fresh data pull? Are the rules different for text files as opposed to Web API calls?
If I refresh the page in the browser new data is pulled.
The file is stored on a NAS drive attached to an IIS server.
I have also tried:
$.ajaxSetup({ cache: false });