Workbox

Challenge

Only editable by group admins

  • Last updated November 17, 2018 at 5:48 PM by hankish
  • Evidence only visible to badge awarders
Solve this learning challenge by posting a code snippet.
Workbox has a lot of different functionality, only some of which is critical to Badge List. This challenge will focus on one specific part of that: caching strategies.

To answer the challenge post a code snippet which uses the registerRoute() method to register two routes:
  • One route should use a Stale While Revalidate strategy for anything under '/images'.
  • The other route should use a Cache First strategy for images within '/images/' which start with 'silly_hat_'. (Silly Hat images are an absolutely critical part of this application and any delay in loading the images in unacceptable.)
Also answer the following question (either in the comments of your code snippet entry above or in a separate snippet): Please describe each of the possible cache strategies and why you would use them.