© Dennis Sheppard 2017

Dennis Sheppard, Beginning Progressive Web App Development, https://doi.org/10.1007/978-1-4842-3090-9_4

4. Caching and Offline Functionality with Service Workers

Dennis Sheppard

(1)Tinley Park, Illinois, USA

Now that you know what service workers are and how to implement a very basic one, in this chapter you’re going to go beyond the basics. We want apps to be fast, reliable, and work offline whenever possible. So now I’m going to talk about the Cache API that lets us return items we specify from the cache instead of making the whole journey to the server.

The fetch Event

Before you can cache anything, you need to be able to intercept network requests. That’s trivial using your service worker. Every network call originating ...

Get Beginning Progressive Web App Development: Creating a Native App Experience on the Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.