Skip to content

Add ability to create a local cache instance #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lindskogen
Copy link

@lindskogen lindskogen commented Oct 18, 2022

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 :)

Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, i'm gonna be honest here, you really haven't put any information as to the problem you're trying to solve, why this solves the issue, why you think we should resolve the issue. So if you can edit your description to be a thorough PR description this can be considered.

If you need some help take a look at this: https://github.blog/2015-01-21-how-to-write-the-perfect-pull-request/#approach-to-writing-a-pull-request

@lindskogen
Copy link
Author

Sorry. I updated the description now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants