Technical reference
Service workers: why a web app can show yesterday’s interface
The page, its cache and its network data can be on different versions. A successful deployment does not update every open tab immediately.
Research articles and reference entries are published in English. Navigation is available in seven languages.
In this article
A browser can answer without your server
A service worker is a script registered for an origin and scope. It can intercept requests and answer from a cache, enabling offline interfaces and faster loading. Production use normally requires HTTPS. This is useful plumbing, but it creates another place from which an application can receive content.
A new worker goes through installation and activation. By default, an installed replacement waits while the old worker still controls clients. Uploading new files therefore does not prove that an already open trading page is using them. Reloading one tab may not retire another tab’s old worker.
Separate interface freshness from price freshness
Cache storage is application-managed. Updating the worker does not automatically make every cached response current. Developers need a deliberate asset-version and cache-cleanup policy. A polished interface can consequently load while its scripts, cached data or API assumptions belong to different releases.
For a trading application, treat cached layout assets differently from balances, quotes and transaction state. An old quote should not quietly become the value a user approves. Re-fetch the necessary state, show its age and review the transaction after an update. Those are design checks, not properties supplied by the service-worker API.
Investigate before clearing everything
When diagnosing a mismatch, record the page URL, visible release identifier, active worker script and any waiting worker. Browser developer tools expose the registration and caches. Compare a fresh browser context with the existing one to separate a server deployment problem from a retained client version.
A site-data reset may remove local watchlists or other unsynced preferences, so preserve them first. For developers, test an update with two tabs open and with the network unavailable. If activating a replacement immediately, account for old pages still running older code and avoid disrupting an in-progress review.
