问题
I am using d3.text() to load a text file. I want to avoid using the cache of the browser. Anybody knows how this can be done? Thanks!
回答1:
Don't see how the MIME type would do anything for this issue.
You can avoid caching by appending a random number to the url (this is a general practice that has nothing to do with d3). So, if your url is
var url = 'http://www.example.com/somthing';
Then make your request
d3.text(
url + '?' + Math.floor(Math.random() * 1000)
);
More info here
来源:https://stackoverflow.com/questions/13053096/avoid-data-caching-when-using-d3-text