Skip to content
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

can we do something like if it's not accessed for x amount of time delete it? #290

Open
sohail0992 opened this issue Jun 3, 2022 · 1 comment

Comments

@sohail0992
Copy link

I have two concerns about this package.

  1. I am not sure how much memory it will be using, I am creating cache in my solution per user. what if my users increment from let's say 100 to 1000. can you suggest me something to do a test for memory usage?

  2. can we do the time thing if it's not accessed for x amount delete that key and value?

@pvogel1967
Copy link

I have two concerns about this package.

  1. I am not sure how much memory it will be using, I am creating cache in my solution per user. what if my users increment from let's say 100 to 1000. can you suggest me something to do a test for memory usage?
  2. can we do the time thing if it's not accessed for x amount delete that key and value?

IMHO, a package like this should be used for the most performance critical areas (i.e. something that needs to be looked up on every request). If you start using this for per-user data cache then you are locking the user to a specific server because that's the only server that has that user's data in cache.

redis (ioredis package for the client) is a far better solution for the kinds of thing you mention here. Shared cache across all servers ensures you keep your service stateless and takes care of removing cached data after the TTL expires.

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

No branches or pull requests

2 participants