Chapter 8. The Offline User Experience

We haven’t really talked about the contents of /offline.html, the fallback page you made for the situation when all else fails. It’s entirely up to you what you put on that page—something silly or something useful. If you decide to make it useful, the Cache API can help.

So far, you’ve used the power of the Cache API from within your service worker script. But the Cache API can be accessed from other places too. You can call forth the power of the Cache API from your web pages, including your offline page.

You’ve got a cache of pages that your site’s visitor has accumulated on their journey through your site. If that visitor loses their internet ...

Get Going Offline 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.