When syncing, the wallet is using an in-memory filesystem to store the cache file, which is deleted once the browser tab is reloaded or closed. This leads to constant full syncs which cost time and bandwidth.
monero-javascript supports writing to an arbitrary filesystem as long as it implements the nodejs's fs interface. Public implementations are available for localStorage and IndexedDB.
localStorage can store up to 5MB which probably isn't enough[1] to store the cache, however, IndexedDB allows to allocate more storage and seems like a better fit for this use.
Some of the public implementations are, however, incompatible with monero-javascript due to the latter requiring synchronous API.
When syncing, the wallet is using an in-memory filesystem to store the cache file, which is deleted once the browser tab is reloaded or closed. This leads to constant full syncs which cost time and bandwidth.
monero-javascript supports writing to an arbitrary filesystem as long as it implements the nodejs's
fs
interface. Public implementations are available for localStorage and IndexedDB.localStorage can store up to 5MB which probably isn't enough[1] to store the cache, however, IndexedDB allows to allocate more storage and seems like a better fit for this use.
Some of the public implementations are, however, incompatible with monero-javascript due to the latter requiring synchronous API.
[1] https://github.com/monero-project/monero/issues/8366