ethereal-react icon indicating copy to clipboard operation
ethereal-react copied to clipboard

Cache rework

Open kesne opened this issue 2 years ago • 0 comments

Right now the cache is global, which works well, and even works for when providers change. However, this doesn't make a lot of sense long-term, because it causes unbounded cache growth, and resetting the provider doesn't actually free any memory.

I think there's a couple ways to solve this:

  • Cache object is provided by the provider itself. This should help clean up memory when providers are reset / removed.
  • Cache is a user-configurable LRU cache, with the ability to explicitly retain data that is actively being used.
  • Hooks cause data being used to be explicitly retained (need to figure out how this works with suspense and concurrent).

kesne avatar Oct 19 '21 17:10 kesne