Menu
Back to Discussions

caching stale data: what's your ttl sweet spot?

Sofia Valdez
Sofia Valdez
·2735 views
Hey everyone, I've been thinking a lot about cache invalidation lately. We're using Redis for caching user session data, and it's been working pretty well. The main challenge, though, is setting the Time-To-Live (TTL) for our cache entries. If it's too short, we hit the database way too often, and if it's too long, users end up seeing stale information. So, what are your strategies for finding the right TTL? Do you just use a fixed duration, go with dynamic TTLs based on how often data changes, or something else? I'm really curious to hear your war stories and best practices.
35 comments

Comments

Loading comments...