Avoid caching data when using d3.text

I am using d3.text () to load a text file. I want to avoid using the browser cache. Does anyone know how to do this? Thanks!

+4
source share
1 answer

I do not see how the MIME type will do anything for this problem.

You can avoid caching by adding a random number to the url (this is a common 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 here

+12
source

Source: https://habr.com/ru/post/1441854/


All Articles