recently the development process encountered a problem:
there is a large amount of data on the page that needs to be temporarily stored, used in other modules, and cleared when the page is closed.
the original sessionStorage, is easy to use and has good compatibility. Until once, the flow graph of 6000 nodes information was saved at one time, and then the storage exploded. (Google browser 66.0.3359.139 (official version 32-bit))
assume that the storage capacity of sessionStorage is 5m, and the amount of flow graph data of 6,000 nodes is more than 5m, so it is convenient for calculation to take 6000 nodes / 5m as a unit.
in the requirement, there may be 10, 000 node data in a flow graph. That is, one-time storage reaches at least 10m .
in addition, there will be multiple flow graphs on a page, so to be on the safe side, the total storage of is approximately 100m .
the idea that comes to mind for the time being is that the storage of
1 data is handed over directly to the background. Advantage: the problem of data storage is solved. Disadvantages: the request is time-consuming, unstable and inconvenient to clear.
2 uses indexedDB. Pros: enough storage, no background. Disadvantages: compatibility is not good, API operation is not convenient.
3 uses other open source plug-ins. This has not found a more suitable for the time being, consult the localForage documents, see the operation is very convenient, but it seems to have a storage capacity of 5m.