A code-first introduction to background syncing with service workers, the Sync API, and IndexedDB.
Credit: Pasuwan / Shutterstock
Progressive web apps (PWAs) are an important concept in web development because they combine the universality of browser deployment with the features of natively installed software. In delivering native-like functionality, being able to run background and offline operations is key.
An especially critical feature of progressive web apps is their ability to deal with situations where a user has submitted something like an email but the network is not available to process it. In this article, you’ll learn how service workers and the Sync API support offline processing in PWAs. You’ll also be introduced to IndexedDB, the browser’s built-in database.
Introduction to service workers
Considerable thinking goes into making a browser-based application behave more like a native one. The service worker is a key part of that process. A service worker is a more constrained variant of a worker thread, one that communicates with the main …