Sjors
Sjors

Reputation: 93

the data is changed, but reloading does not fetch new data, D3

So I load my data in D3 with the d3.csv() function. When I change the CSV file and reload the http page, it still uses the old data. How can I get D3 to use the new data in de CSV file instead of the old data?

Thanks in advance

Upvotes: 3

Views: 366

Answers (1)

Vipin Kumar
Vipin Kumar

Reputation: 6546

Seems like caching issue. Add a cache buster to it i.e, append some random string to your url.

d3.csv('/getdata?_=' + new Date().getTime())

By using this, browser will not be able to identify similarity of requests.

Upvotes: 4

Related Questions