Skip to content
Performance·Intermediate·Output based·1 min read

How do you prevent stale worker results?

Short interview answer

Give requests ids or versions, cancel work through a protocol where feasible, and ignore results that are no longer authoritative. Terminate workers when their owner ends unless they are intentionally shared.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Web Workers and the main thread

Related questions