I'm actually running a JS script (ES6 and Guzzle) in the browser (it have to run in a browser, no NodeJS). This script is calling some xml files, and store results for later usage (I output the convert and output then process it to be able to import it in a database).
So this script will generate an array containing thousands and thousands of small JS object (from XML parsing).
As the script take really long to run, I'm looping on my URL array (I have a list of all file URL), and storing query result into a classic JS variable, and local storage after jsonEncode. As it's JSON-encoded, the localStorage value is erased every time and a new bigger string is saved for the same key.
My question :
- Is it better to use only a classic variable? Or only the local storage?
- Is there any other way to store a large amount of data for a script? (temporary blob, text file, DOM append...)
From my tests, after 3-4k files queried and result stored, the browser starts to slow down a lot and drastically reduce the number of HTTP request/minutes.
Thanks !
Notes :
- It have to run in a browser (I need some dynamic DOM data, it's an internal dashboard that display stats, with user inputs for live settings).
- It need to run only on latest Chrome or Firefox
jQuery Ajaxwhy can't you post to an API and drop that data there?var MyVar = [];thenMyVar.push(). That's what I'm calling "simple" variable.