# Week 12 - Caching and Custom Protocols

# Caching Strategies

There are a number of ways that we can approach the logic of fetching and caching in our Service Workers.

When do you want to get a file from the cache? Before or after attempting a fetch?

When do you want to cache a file? When the Service Worker installs or when a file is fetched?

Do you want to ever update a cached file? Do you send the cached copy to the browser and fetch a new version for the cache at the same time?

This web.dev guide (opens new window) talks about some of these strategies.

# Custom Protocols

Did you know that it is now possible to register a custom protocol to be handled by your website?

For example, links that start with the protocol mailto: will open your mail client and sms: will trigger your SMS messaging client.

We can create a protocol that is connected with our website so that a link which begins with our protocol will trigger opening the browser and navigating to our website. If that website is installed as a PWA, then a custom protocol, like web+beer: could open our PWA.

MDN reference for custom protocol registering (opens new window)

Learn more about Custom Protocols

TODO

  • Read the content and watch the videos for Weeks 9 - 12
  • Review concepts about Service Workers, Indexed DB, and PWAs that you are still uncomfortable with.
  • Review the requirements for the 4th Project - PWA
  • Find your partner for the MAD9124 & MAD9022 Joint Final Project.
  • Let your professors know who your partner is for the joint final project.
Last Updated: 3/28/2021, 12:40:30 PM