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 disappear on refresh
The first report was blunt: "Is it intentional that the pending-plugin badges all vanish when I refresh?"
Not intentional. It was a bug. _updatesDashState was designed as a localStorage-backed persistent cache — but the restoration call only ran the moment the dashboard was opened.






