Reveals whether a service worker will be responsible of doing the sync requests towards Dexie Cloud Server or if it will be done in the main thread. This will depend on the configuration parameter tryUseServiceWorker and whether the current browser engine is supported to utilize service worker for sync events and whether a service worker was registered by your application.
There are benefits of letting a service worker do the sync requests but it is not required for the addon to work. A service worker can sync in the background, after you app has been closed or the user has put their device in pocket. In some browsers, service workers are also able to periodically sync a few times a day to keep the local database relatively updated also when not using the application.
In order to make a service worker take care of sync, you need to do the following steps:
- Register a service worker for your application.
- Let your service worker import dexie-cloud-addon’s service worker module using
- In your db module, configure db.cloud with tryUseServiceWorker
If all of these things are done and you run it in a compatible platform, the
db.cloud.usingServiceWorker should be returning true after the db is open.
Dexie Cloud Docs
- Access Control in Dexie Cloud
- Add demo users
- Add public data
- Authentication in Dexie Cloud
- Consistency in Dexie Cloud
- Dexie Cloud API
- Dexie Cloud CLI
- Dexie Cloud Docs
- Dexie Cloud REST API
- Purchase Subscription
- Run Dexie Cloud on Own Servers
- Sharding and Scalability