Jstree 3.0.2 dynamic tree always loads data from the cache instead of a new call to the server

I have jstree. when loading a page, jstree fills the file from the server when it makes a new call on the server, but after that, when I refresh the page, it will always extract data from the cache and not call the server, thereby always accepting the old data for filling. I am using jstree version 3.0.2. Below is the code that jstree generated when the page loaded.

$('#tree').jstree({
'core': {
data:{
'url':'getjstree'   // this is the url which will get the json data from the server
}
}});

how do we solve this in order to get fresh data for each call, one solution that I used to think about using is javascript code for a hard update, calling

location.reload(true);

but this updated the json data, but went into a recursive call and thereby hung the page. Help us solve this problem.

+4
3

$('#tree').jstree({
'core': {
data:{
'cache':false,
'url':'getjstree'   // this is the url which will get the json data from the server
}
}});
+1

JSTree localStorage "jstree". jstree localStorage, :

//Removes jstree cached state from localStorage
localStorage.removeItem('jstree');

$('#tree').jstree({
    'core': {
        data:{
            'url':'getjstree'
        }
    }
});
+5

url...

'url' : function(node){
    return "/myrequestpath?randParam="+getRandParam();
}
                                                }

getRandParam, 1 1000... , , , . , url, ( , URL- , ).

0
source

All Articles