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

Add ability to create a local cache instance

Open lindskogen opened this issue 3 years ago • 1 comments

We're generating a lot of cache keys in our app, and would like to clear all keys under a specific "namespace".

  1. My first idea was to add the ability to clear keys by prefix, but searching through all the keys seems like a bad idea for perf.
  2. My other suggestion is to create a cache specific to each use-case in the app, and a clear function to delete the whole list in that namespace.

This seemed like more in-line with the direction the React team are taking with scoped cache.

We're already using this solution in our production app with great results :)

lindskogen avatar Oct 18 '22 16:10 lindskogen

Sorry. I updated the description now!

lindskogen avatar Oct 19 '22 11:10 lindskogen