Browser internals·Advanced·Coding·1 min read
How does background sync differ from just retrying a failed fetch in application code?
Short interview answer
A background sync request registered with the service worker is deferred by the browser until connectivity is actually available, and can complete even if the page that registered it has since been closed, whereas a manual retry in page code only runs while that page stays open and the network hasn't dropped mid-retry.
Key takeaway
Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.