I'm working on an api, which I get the data from the db then display as json. The data is big and increases every second, I manage to lessen the load by saving it in localStorage on first load then just load the latest data on next fetch then add it to the localStorage. My problem is, it reached the max size of data. Is there a way to do it on php?
JS
if(index == 0){
localStorage.setItem("figureChart1-"+aid, JSON.stringify(data));
var arrseries1 = data['B5'];
var arrseries2 = data['B6'];
var datetime = data['datetime'];
} else {
var chart1Json = JSON.parse( localStorage.getItem( 'figureChart1-'+aid ) );
var obj = {};
obj['id'] = chart1Json['id'].concat(data['id']);
obj['datetime'] = chart1Json['datetime'].concat(data['datetime']);
obj['B5'] = chart1Json['B5'].concat(data['B5']);
obj['B6'] = chart1Json['B6'].concat(data['B6']);
localStorage.setItem("figureChart1-"+aid, JSON.stringify(obj));
var arrseries1 = obj['B5'];
var arrseries2 = obj['B6'];
var datetime = obj['datetime'];
}