PWA Update Not Applying — What It Means & How to Fix It
About PWA Update Not Applying
Fix Progressive Web App update not being applied when the service worker cache serves stale content despite new deployments. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: PWAs use service workers to cache assets for offline use, but stale caches can serve outdated content. The service worker lifecycle (install, waiting, activate) means updates do not apply immediately. A new service worker installs but waits until all tabs using the old service worker are closed. Users may see old versions of the app for hours or days if they do not close all tabs. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: New service worker installed but stuck in 'waiting' state because old tabs are still open. Cache-first strategy serving stale assets before checking the network for updates. Browser caching the service worker file itself (sw.js should have no-cache headers). skipWaiting() not called in the new service worker, leaving it in waiting state. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Close all tabs of the PWA and reopen — this allows the waiting service worker to activate. In Chrome DevTools > Application > Service Workers, click 'Update' then 'Skip Waiting'. Ensure the server sends Cache-Control: no-cache for the service worker file (sw.js). Implement a 'New update available' notification that calls skipWaiting() when the user confirms. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our Browser Errors collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
Should I always use skipWaiting()?
Not automatically. skipWaiting() activates the new worker immediately, which can cause issues if the old cached page is incompatible with the new worker's responses. Best practice: prompt the user and call skipWaiting() on confirmation.
Overview
Fix Progressive Web App update not being applied when the service worker cache serves stale content despite new deployments.
Key Details
- PWAs use service workers to cache assets for offline use, but stale caches can serve outdated content
- The service worker lifecycle (install, waiting, activate) means updates do not apply immediately
- A new service worker installs but waits until all tabs using the old service worker are closed
- Users may see old versions of the app for hours or days if they do not close all tabs
Common Causes
- New service worker installed but stuck in 'waiting' state because old tabs are still open
- Cache-first strategy serving stale assets before checking the network for updates
- Browser caching the service worker file itself (sw.js should have no-cache headers)
- skipWaiting() not called in the new service worker, leaving it in waiting state
Steps
- 1Close all tabs of the PWA and reopen — this allows the waiting service worker to activate
- 2In Chrome DevTools > Application > Service Workers, click 'Update' then 'Skip Waiting'
- 3Ensure the server sends Cache-Control: no-cache for the service worker file (sw.js)
- 4Implement a 'New update available' notification that calls skipWaiting() when the user confirms