effect-js icon indicating copy to clipboard operation
effect-js copied to clipboard

Implement IPFS cache system

Open jeisses opened this issue 1 year ago • 2 comments

IPFS objects should be cached to avoid too many HTTP calls.

This should be done by a generic cache interface. The default cache implementation should be an in-memory one (perhaps a Map). On initializing the SDK users should be able to provide an alternative cache implementation for persistence. For web applications this will likely be LocalStorage, which should be provided by the SDK as an import. React Native and NodeJS apps will be able to provide their own implementations.


Side notes The complexity of this cache system is still up for discussion. A more advanced system could implement a key expiry setting, to allow the cache to be used for get_table_rows. And it could perhaps item loading states to avoid asynchronous loading the same item into the cache. These advanced features may be explored but are not mandatory right now.

jeisses avatar Mar 23 '24 07:03 jeisses