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

Cache channel membership data #762

Closed
nikkothari22 opened this issue Mar 19, 2024 · 1 comment
Closed

Cache channel membership data #762

nikkothari22 opened this issue Mar 19, 2024 · 1 comment

Comments

@nikkothari22
Copy link
Member

While channel type is cached and helps improve perf for Open and public channels, for private channels we still have to check if the user is a member of the channel or not - this occurs in a db.exists query. The problem will compound when we add organisations (#679) and have to check permissions for users.

Solution:

  1. Cache the user's channel permission in Redis
  2. If a channel member is deleted/changed - clear the cache
  3. When checking permissions, read from cache, else fetch from DB and populate the cache (need a utility function for this)
Copy link

linear bot commented Mar 19, 2024

@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant