Investigate why a cached value is stale or missing
When to use: A user says 'I updated my profile but it's still showing the old name' — likely a cache invalidation issue.
Prerequisites
- Redis URL with at least read access —
REDIS_URL=redis://:pw@host:6379/0
Flow
-
Find the right keyScan keys matching
user:profile:42*— show each with its type and TTL.✓ Copied→ Matching keys list -
Inspect the stored value and expiryFor
user:profile:42, GET the value and show the TTL. Is it stale vs expected?✓ Copied→ Value + TTL + verdict -
Bust it deliberatelyDelete that key (and any related list/set keys) so the app repopulates on next read. Confirm deletion.✓ Copied→ DEL returned 1 or more
Outcome: A confirmed-fixed cache with a trail of what was stale and why.
Pitfalls
KEYS *on a big instance stalls the server — Always use SCAN (the server translatesscantools to non-blocking cursors); neverKEYS