Three pitfalls in a dashboard cache lifetime — boot-time restore, TTL, and partial invalidation
We added a cache-first design to the cross-site updates dashboard, then wired the site-list badge to read from the same cache. Both ships went well. But as soon as it hit real usage, we hit three distinct pitfalls around the cache’s “lifetime” in quick succession: “the badges all disappear on refresh,” “the 7-day TTL is too short,” “running maintenance on one site clears all the badges.” Each is a small spec call in isolation, but from the user’s side, all three feel like the same symptom: “badges aren’t sticking around the way I expect.” This post walks through each fix and what we got wrong. Pitfall 1 — All badges …