[Support Guide] Understanding & unregistering service workers

Last reviewed by Netlify Support - July 2025

A service worker is a script that your browser runs in the background to accomplish a variety of tasks. Browsers cache service workers for 24 hours by default, and don’t update them when you reload your page. Therefore, you may have a service worker on your site which could prevent you from seeing the latest and greatest changes that you’ve made.

If you suspect a service worker is causing this issue, I recommend disabling/removing the service worker from your site and unregistering it to see your latest change. You can unregister by going to your browser dev tools, under 'Application > Service Workers', there will be an option to unregister your current service worker.

Alternatively, you can use the following snippet in a javascript file or in the dev tools console:

navigator.serviceWorker.getRegistrations().then(function(registrations) {
  for(let registration of registrations) {
    registration.unregister()
    document.location.reload()
} })

If you have a different issue with a service worker, or need more information, comment below!

1 Like
Netlify + Gatsby serves old/cached (pre-Gatsby) version of site
Old version of website shown, works in incognito
Cache problems - old versions stay for a long time
Each new deploy requires hard refresh on clients
Primary domain cache problem
Netlify Function triggered on form submission includes incorrect payload
Running a script that updates a file before build
Redirect from Netlify subdomain to custom primary domain not working
Issue clearing an old cache file after a domain change
Form entries not collected
I've enabled my site through netlify for https. But my js files are still loaded with 1.1 http protocol
Custom domain doesn't update but netlify.app version does
“Uncaught SyntaxError: Unexpected token <” on deploy using Netlify
Netlify Form | CRA | ServiceWorker
Should Netlify clear cache when I upload from Gatsby Cloud?
Permanently forward Netlify subdomain to custom TLD
DNS changes not always correct after 48 hours
About caching gatsby pages
Nuxt - Some pages doesn't redirect to the right page correctly after refresh
Form 404 - Static Form in Svelte / Sapper
Deployed Gatsby Site Doesn't Represent Development Mode Site
Netlify serve old cached version
React build times out although the required file exists (Error: ENOENT: no such file or directory, open '/opt/build/repo/src/index.js')
Tranform Images not working with Large Media with Sapper
301 redirect not working
Understanding Browser Cache + Netlify
Clear Cache on every deploy
Form submission - correct POST reply, but no entry on the submissions page
Weird situation on multiple Sites. Index page not updating
Netlify serve old cached version
Site not displaying updated GitHub commits
Trying Forms on React deploy
Site not updating with Github build
Cache issue on Netlify?
DNS records pointing to old Netlify site, not changed when same domain added to new site
Netlify serve old cached version
Ionic deployment problem
Domain still shows old site on my computer
Site is live, but sill blank screen (react app)
Added new site using old url, and Netlify display old website (continuous deployment)
Netlify cache not clearing client-side, even after triggering cache deploy
[Support Guide] Handling code-splitting issues on Netlify
Hello, my site is not updating despite no errors
Old version of website shown, what could cause this?
Only getting 404 through proxy
Cache issue on Netlify?
Does netlify clear cache every deploy?
Browser cache not clearing for Safari on custom domain
Cached version of website not updating on new build/repo change
Site not updating
Forms doesn't work in some browsers (Gatsby)
Do DNS records update automatically when you add a domain you own to a Netlify site?
Website Not working Even though DNS seems to be correct
Image load then disapear

Browsers cache service workers for 24 hours by default

read up a bit on this and found this progressive web apps - Service worker JavaScript update frequency (every 24 hours?) - Stack Overflow

" The one exception to standard HTTP caching rules, and this is where the 24 hours thing comes in, is that browsers will always go to the network if the age of the service-worker.js entry in the HTTP cache is greater than 24 hours. So, functionally, there’s no difference in using a max-age of 1 day or 1 week or 1 year—they’ll all be treated as if the max-age was 1 day."

1 Like

I played around with Vue pwa and service workers and kept finding that my site serves an old version.
After refreshing then only do I see the new changes.

I removed the pwa plugin and unregistered the service worker as per your instructions.

How can I be sure that my other viewers are not experiencing the same problem.

Site: https://span.com.na

Problems caused by service worker canot be fixed from Netlify’s end. I don’t see any issue at the moment as I never visited your website before and it doesn’t seem to have a service worker now. The only ones you can verify the problem are the ones who have visited your site before and got the service worker installed.