1

I am parsing a csv file that's on the server:

var readCSV = function(url){
    Papa.parse(url, {
        download: true,
        header: true,
        complete: function(results) {
            listen = results.data;
        }
    });
}

Unfortunately still reads an old file from cache even though I have already replaced it on the server. Is there some way to prevent it from using the cache?

Chris
  • 13,100
  • 23
  • 79
  • 162

1 Answers1

10

You could use a cachebuster to read your new file. So your URL should look like.

var readCSV = function(url){
    Papa.parse(url+"?_="+ (new Date).getTime(), {
        download: true,
        header: true,
        complete: function(results) {
            listen = results.data;
        }
    });
}