-
-
Notifications
You must be signed in to change notification settings - Fork 3k
feat: caches user data with 5mins of redis TTL (@LuckySilver0021) #7415
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
base: master
Are you sure you want to change the base?
Conversation
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
|
hi @LuckySilver0021 , thank you for your contribution. I am not sure this is a useful cache to add. The frontend will call the /users endpoint only once per session. Because of this, it is not very likely we get a second call for the same user within five minutes. Adding redis cache will increase the load on redis and memory we will have to take into account. |
Oh yea, that makes sence. Adding single-session caching makes close to no difference, Im no expert and can be wrong but, what if we pivot this pr to caching top maybe 100 leaderboard users since leaderboard browsers hit these repeatedly across sessions (what ive noticed) anyways im happy to pivot the PR to whichever makes most impact |
8ae76df to
4d4ffb7
Compare
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
|
Caching the first page of the all-time leaderboards could be useful. But instead of using redis let's just introduce a local cache.
|
Exctly I will use localStorage for that, thanks for the approval tho. |
Description
feat(backend): This is a feature implimentation which aims to reduce db load by introducing a redis layer for caching of user profile
backend/src/utils/cache.ts- get/set helpersGET : /api/controllers/user.tswith 5min of TTLTested locally with Redis and MongoDB.
Checks