O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building Progressive Web Apps

Book Description

If you’re working on the Web, you’ve probably heard something about Progressive Web Apps. But what exactly are they and what kind of benefit will they bring you? With this book, you’ll gain a practical understanding along with the skills needed to use Service Workers and other technology central to building Progressive Web Apps. PWAs are pushing the mobile web forward, aim to bring parity to web and native apps, and help mobile developers reach users beyond the confines of native app stores.

With this book, learn how to build websites that take advantage of features that have so far been the exclusive domain of native apps. Reach out to your users with push notifications and homescreen icons, speed up your site significantly and provide a fully functional app even when your users are offline or suffering from bad connectivity.

Table of Contents

  1. 1. Introducing Progressive Web Apps
    1. The Web Strikes Back
    2. The Current Mobile Landscape
    3. The Progressive Web App Advantage
    4. The Tab, The Web, and the Service Worker
    5. Book Overview
  2. 2. Your First Service Worker
    1. Setting Up Our Sample Project
    2. The Current Offline Experience
    3. Creating Your First Service Worker
    4. What is Progressive Enhancement?
    5. HTTPS and Service Workers
    6. Fetching Content From the Web
    7. Capturing offline requests
    8. Sending HTML Responses
    9. Understanding Service Worker Scope
    10. Summary
  3. 3. The CacheStorage API
    1. What CacheStorage is, and More Importantly, What It Is Not [TODO]
    2. Listening to the Install Event
    3. Storing Requests in CacheStorage
    4. Retrieving Requests from CacheStorage
    5. Caching Assets in Our Sample App
    6. Matching the correct Response to each Request
    7. Summary
  4. 4. Service Worker Lifecycle and Cache Management
    1. The Service Worker Lifecycle
    2. Developer Tools
    3. Updating Our Service Worker
    4. Why We Need To Manage The Cache and Update the Service Worker
    5. Cache Management and Clearing Old Caches
    6. Configuring the Server To Serve The Right Caching Headers
    7. Summary
  5. 5. Embracing Offline First
    1. What is Offline First?
    2. Common Caching Design Patterns
    3. Mix and Match: Creating New Patterns
    4. Planning Our Caching Strategy
    5. Implementing Our Caching Strategy
    6. Application Shell Architecture
      1. Including Content in the Initial Render
    7. Implementing App Shell
    8. Achievement Unlocked
    9. The Right Tool for the Job
  6. 6. Storing Data Locally with IndexedDB
    1. What is IndexedDB
    2. Using IndexedDB
      1. Opening a database connection
      2. Database versioning / modifying an object store
      3. Adding data to an object store
      4. Reading data from an object store
      5. IndexedDB version management
      6. Reading objects with a cursor
      7. Creating indices
      8. Reading data using an index
      9. Limiting a cursor’s range
      10. Setting a cursor’s direction
      11. Updating objects in an object store
      12. Deleting objects from an object store
      13. Deleting all objects from an object store
    3. IndexedDB for SQL Ninjas
    4. IndexedDB In Practice
    5. The Database That Was Promised
    6. IndexedDB Housekeeping
    7. Using IndexedDB in the Service Worker
    8. The IndexedDB Eco System
    9. Summary