On this page
What this issue is
A service worker is a JavaScript file that a browser installs for your site. It sits between the page and the network and can answer requests from a cache. Progressive web apps, some themes, some plugins and some frameworks add one without you noticing.
The problem starts when the worker keeps serving cached HTML, scripts or API responses from an older release. The browser checks for a new worker file, but the new one often waits until every tab using the old one is closed. Until then, the old worker keeps answering.
Why it costs you leads or sales
Returning visitors are often your warmest ones: people who saw an ad, left, and came back to buy. If they get the old version, they may see an expired offer, a form that posts to a retired endpoint, or a checkout script that no longer matches the server. Tracking tags you added or fixed in the latest deploy may be missing for them too.
It is hard to catch because you and your team usually test in a fresh or hard-refreshed browser. The bug only shows for people who already have the old worker installed.
- Deploy new releaseServer now has the fixed site
- Returning visitor opens siteOld service worker is still active
- Worker serves cached filesOld HTML and scripts returned, network skipped
- Old form or offer shownRetired endpoint or expired price
- Lead or saleSubmission fails or is never made
The deploy succeeds on the server, but returning visitors never receive it.
How to check if your site has it
Open DevTools Application panel
In Chrome or Edge, press F12 and open Application, then Service workers. If a worker is listed for your domain, your site uses one.
Compare versions
Load the site in a normal window that has visited before, and in a fresh Incognito window. If they differ (different text, form, banner), a worker or cache is serving old content.
Look at the status
A worker marked 'waiting to activate' means a new version is downloaded but the old one still controls the page.
Inspect the cache
Under Application, Cache storage, open each cache and check which HTML, JS and API URLs are stored.
Check how the worker file is cached
In the Network tab, find your service worker file (often sw.js) and read its Cache-Control header. A long max-age delays updates.
How to fix it
First decide whether you need a service worker at all. Most lead-generation sites and stores do not. If you do not need offline use or push notifications, remove it. If you do, make it update reliably.
Find what registers the worker
Check plugins for PWA, offline or caching features (Plugins screen, then settings of any PWA or performance plugin). Search the theme for navigator.serviceWorker.register.
Disable or update it
Turn off the PWA or offline option, or update the plugin. Then purge the page cache and CDN cache.
Ship a kill switch
If visitors still have the old worker, serve the cleanup worker shown below at the same URL the old one used.
Check theme and apps
Search the theme code (Online Store, Themes, Edit code) for serviceWorker. Also review installed apps that add PWA or app-like features.
Remove or update
Remove the registration code or uninstall the app, and then check no leftover snippet remains in theme.liquid.
Check custom code
In Site settings, Custom code, and page-level custom code, search for serviceWorker. Webflow does not add a worker by itself.
Remove and publish
Delete the registration script, publish, and then use the unregister snippet below if visitors are stuck.
Look for custom HTML tags
Search your container for custom HTML tags containing serviceWorker.register.
Pause and publish
Pause or edit the tag, add a cleanup tag if needed, and publish a new container version.
Version your caches
Put a version in the cache name and delete old caches in the activate event.
Take control quickly
Call self.skipWaiting() in install and clients.claim() in activate, so new workers take over without waiting for tabs to close.
Do not cache the worker file for long
Serve sw.js with Cache-Control: no-cache. Use network-first for HTML pages and API calls.
If you keep a worker, this pattern removes old caches and activates new versions straight away.
const VERSION = 'v2024-06-01';
const CACHE = 'site-' + VERSION;
self.addEventListener('install', (event) => {
self.skipWaiting();
event.waitUntil(caches.open(CACHE));
});
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys()
.then((keys) => Promise.all(
keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))
))
.then(() => self.clients.claim())
);
});
self.addEventListener('fetch', (event) => {
if (event.request.mode === 'navigate') {
event.respondWith(
fetch(event.request).catch(() => caches.match(event.request))
);
}
});If you want to remove the worker entirely, replace the old worker file (same URL) with this self-destructing one. Visitors' browsers fetch it, clear the caches and unregister.
self.addEventListener('install', () => self.skipWaiting());
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys()
.then((keys) => Promise.all(keys.map((k) => caches.delete(k))))
.then(() => self.registration.unregister())
.then(() => self.clients.matchAll())
.then((clients) => clients.forEach((c) => c.navigate(c.url)))
);
});Stale worker
- Returning visitors see last release
- New worker waits for tabs to close
- sw.js cached for a long time
- Only fresh browsers show the fix
Updating worker or none
- New release reaches returning visitors on next load
- Old caches deleted on activate
- sw.js served with no-cache
- Pages fetched network-first
How to confirm it's fixed
- In a profile that still has the old worker, load the site once or twice and confirm the new version appears.
- In DevTools, Application, Service workers shows the new worker as activated, or no worker at all if you removed it.
- Cache storage contains only the current version name.
- The sw.js response has Cache-Control: no-cache (or a short max-age).
- Your form submits and the test lead arrives in your inbox or CRM.
- Tracking hits for the page appear in the Network tab or your platform's debug view.
How to prevent it happening again
- Only use a service worker if you need offline use or push notifications.
- Change the cache version on every release, ideally automatically in your build.
- Never cache HTML, forms or checkout API calls cache-first.
- Serve the worker file with no-cache headers, and keep its URL stable.
- Add a returning-visitor test (old profile, new release) to your release checklist.
- Review plugins, apps and tag manager tags that may add a worker.
Day 0
You fix a broken form and deploy. Fresh browsers work.
Day 1
Returning visitors still get the cached old page and form.
Day 3
Leads from returning visitors still look low, but your own tests pass.
Day 4
You find the worker, ship the kill switch or fixed worker.
Day 5
Returning visitors get the current version on next load.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. A robot visitor runs your real journeys on a schedule, and checks each step, the tracking hits and whether test leads arrive. If a stale worker or cache breaks a step, such as a form that no longer submits or a tag that no longer fires, the failure is re-checked from a second region and you get one alert with a screenshot and a likely cause.
What it does not do is reproduce a returning visitor who already holds an old service worker. The robot starts from a clean visit, so it sees the current release, not the stale copy your past visitors may still get. FunnelGuard does not inspect which service workers or caches are installed in real visitors' browsers.
Cover the rest by hand: after each release, open the site in a normal browser profile that visited before, follow the checks above, and confirm the new version loads. FunnelGuard's Free plan (1 site, 2 journeys, daily checks, no card) is enough to watch your main form and catch the cases it can see.
Questions people ask
Why is my website showing an old version after I updated it?
If it only happens in browsers that visited before, a service worker or other cache is probably serving the old files. Check DevTools, Application, Service workers, and compare with an Incognito window. If the versions differ, update or remove the worker.
How do I unregister a service worker?
For your own browser, open DevTools, Application, Service workers and click Unregister. For all visitors, serve a replacement worker at the same URL that deletes caches and calls registration.unregister(), and keep it live for a few weeks.
Why does a hard refresh fix the site but not for my visitors?
A hard refresh bypasses the service worker and cache for your own session. Your visitors will not do that, so they keep getting the cached copy until the worker updates or is removed.
How do I make a service worker update immediately?
Change the worker file (for example a new version constant), call self.skipWaiting() on install and clients.claim() on activate, and delete old caches during activate. Also make sure the worker file is not cached for long.
Do I need a service worker on a lead generation site?
Usually not. A service worker is useful for offline use and push notifications. For forms, landing pages and checkouts, it mostly adds the risk of serving outdated pages, so removing it is often the safest choice.
Can a service worker break tracking or forms?
Yes. If it serves an old page or script, the form may post to an outdated endpoint and tags added in later releases may be missing. Returning visitors are affected while new visitors look fine.
Can FunnelGuard detect a stale service worker?
Only partly. It catches failures such as a broken form or missing tracking hit in a clean visit, but it does not reproduce a returning visitor with an old worker installed. Test that case by hand after each release.
Related issues
- OPS-292Deploy broke landing page or formFix guide
- OPS-293Deploy removed tracking snippetFix guide
- OPS-300Build artifact missing assets (404 JS chunks)Fix guide
- OPS-294Rollback needed but no previous versionFix guide
- OPS-304Analytics consent config reset by deployFix guide
- OPS-295Staging config in production (API URLs, test keys)Fix guide