You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To update a service worker, you need to close the page controlled by the service worker, or navigate to a page that it doesn't control.
Service workers can have scope explicitly set (but defaults to the containing folder path the SW script sits in):
navigator.serviceWorker.register("/sw.js",{scope: "/my-app/",// will control a page at /my-app/ or /my-app/hello/world,// but not / nor /another-app,// but also surprisingly neither /my-app because of the lack of trailing slash});
Set: cache.put(request, response); or cache.addAll(['/foo','/bar']);.
Get: cache.match(request); or caches.match(request);.
IndexedDB in the browser
You can find IndexedDB in browser dev tools.
Tip: use the idb library for a friendlier API. npm install idb
Database(s) { object stores { keys and values and indexes. Indexes are the same data but ordered by particular properties.
Transaction { read or write actions. A transaction contains steps. If one step fails, DB state is as if none of the steps happened ("atomic" operation - see the "Clean Code" book by Robert Martin).