Offline web apps: caching, queued writes, and conflict resolution
A local-first app works without a network and treats the connection as a bonus. This quiz covers service-worker caching strategies (cache-first, network-first, stale-while-revalidate), durable storage in the browser, and queueing writes made offline so you can replay them later. Then it turns to the hardest part, resolving conflicts when two clients edit the same data, with last-write-wins, version vectors, and CRDTs.
Questions
- Not answered. Which caching strategy returns the cached response right away, then updates the cache in the background?
- Not answered. Which storage APIs can a service worker use directly?
- Not answered. Why does this IndexedDB write throw
TransactionInactiveError? - Not answered. By default, can you count on the browser to keep the data your app writes to IndexedDB?
- Not answered. What do you have to handle when you update the UI optimistically?
- Not answered. What's the one-word name for the key that stops a replayed mutation from running twice?
- Not answered. Which API holds a failed request until the browser is back online, even after the page closes?
- Not answered. What is the main risk of last-write-wins conflict resolution?
- Not answered. What does a version vector (vector clock) actually give you?
- Not answered. Which statements about CRDTs are true?
- Not answered. After the two replicas merge, what value does the G-Counter report?
- Not answered. What does
navigator.onLine === trueactually guarantee?