cache-invalidation
Technical notes on web development, DevOps, and AI integration.
3 articles
- 20:00backend
The Settings Row Was Right and the API Was Wrong
A direct SQL insert updated the row but the settings API kept serving the old value from its boot-time snapshot. The three-layer debug order.
TL;DR: A direct SQL write updated the row, but the settings API kept serving the old value because it answers from an in-memory snapshot built at boot. The footer and JSON-LD disagreeing in one render signaled a freshness problem, not a storage one. Restart the API after direct writes, and verify layer by layer before trusting any single reader.
#caching#cache-invalidation#debugging - 12:32backend
I Almost Deleted My Cache One Key at a Time
Mass-deleting Redis keys felt right until I read the docs. Versioned keys with INCR bumps make stale chat answers unreachable instead.
TL;DR: Editing an article left the Redis-cached AI answers stale, and the author's first fix—scanning and deleting every ask: key—turned out to solve the wrong problem. SCAN is non-blocking; the real pain is tracking key families across workers forever. Versioned keys fix it: bake versions into key names, bump with INCR on edits, and let TTL clean up.
#redis#caching#cache-invalidation - 19:34ai
The AI chat now knows what I am working on
The blog's AI chat now answers 'what are you working on' from local commit history: a narrow port, a version namespace bump, and term mining.
#fastapi#redis#cache-invalidation