Should I Cache Session Data for My Authentication System?

0
6
Asked By CreativeNinja42 On

I'm working on a project where I'm detailing the authentication system, which uses a rolling session ID for user authentication. I'm curious if I should implement caching for session IDs and user info using Redis, especially since we expect around 1-2k users total with about 50 daily active users. Do you think just hitting Postgres for every request will slow things down enough to notice, or should I hold off on caching for now?

3 Answers

Answered By CacheMaster88 On

Honestly, don't stress it right now. You can always add caching later if you begin to notice performance issues. Focus on getting the system running first before jumping into optimizations.

Answered By DevGuru77 On

It’s hard to give a solid answer without more specifics about your app. But based on my experience, prioritize making a great product and user experience rather than optimizing too early. You usually don't need to cache until you've identified measurable performance lags from the system.

Answered By TokenFan99 On

I'm curious why you opted for a session-based approach instead of using bearer tokens. I'm a fan of stateless solutions myself. But regarding your question about caching, I wouldn't worry about it unless performance issues actually arise.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.