Make sure the ServiceWorker (sw.js
) is not being cached by the server (Cache-Control: no-store
) and that it has a deterministic name (no hashing).
Make sure your webapp is served with HTTPS (or localhost for development).
Make sure the browser has cached the latest resources, follow the steps outlined in the updates doc.
Automatic updates isn't the default behavior, but can be achieved using the autoUpdate option
offline-plugin
automatically caches all resources generated by webpack. Any other resource needs to be explicitly cached as external.
The ServiceWorker can only serve resources within its scope. Serve your sw file from the root of your public folder, or supply the correct ServiceWorker.scope
option.
Specify a unique ServiceWorker.cacheName
to avoid it being overridden.
webpack-dev-server
compatibility is unknown for the moment, so if you are using hot reloading, ServiceWorker might not work as it's supposed to.
Make sure you are using the correct prefetchRequest.credentials to allow for cookies.
offline-plugin
is probably not configured to handle these routes. See the appShell
option.
There are multiple ways to fix this depending on your setup. One way is to set cacheMaps.requestTypes to ['navigate']
, caching only those requests.
AppCache.events
are known to be a bit buggy (see updates). Try to avoid using them if possible.
offline-plugin
can cache resources served from a CDN, given the correct configuration. Make sure the resources are served with the correct headers.