Avoid data caching when using d3.text

浪尽此生 提交于 2019-12-29 07:46:29

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!