Description
Basic Service Worker is a small service worker script from pwa-today that helps a web app work offline. It caches static assets and the responses for the routes you list, so pages keep working when the connection drops. It also stores POST, PUT and DELETE requests made while offline in IndexedDB, and retries them once the app is back online. To use it, place service-worker.js and sw-registration.js in your web app's root folder and include sw-registration.js in the footer of each page. The registration script installs new versions of the worker in the background, and the README explains that a new version activates when the app is closed and reopened or when the user navigates to another page. The README also covers a note on iOS and how to update the service worker.…
Highlights
- Caches static assets and routes
- Queues POST, PUT and DELETE requests offline
- Retries queued requests when online
- Registration script with background updates
- Notes on iOS behavior
Ratings & Reviews
No ratings yet
Be the first to rate Basic Service Worker.
People also visit

pwa-development
Progressive Web Apps - service workers, caching strategies, offline, Workbox
Basic Service Worker FAQ
What is it?
A basic service worker script for making a web app work offline.
How do I install it?
Put service-worker.js and sw-registration.js in your web app's root folder, then include sw-registration.js in the footer of each page.
What happens to requests made offline?
POST, PUT and DELETE requests are stored in IndexedDB and retried when the app is back online.
How are updates handled?
New versions install in the background and activate when the app is closed and reopened, or when the user navigates to another page.
What are the best Basic Service Worker alternatives?
Popular alternatives to Basic Service Worker include UpUp, Serwist and Kinto.js. See all Basic Service Worker alternatives


