July 2018
Intermediate to advanced
354 pages
8h 51m
English
The first dynamic caching strategy is in response to a user interaction, such as clicking a button. Instead of this being explicitly caught by the service worker fetch event, it can be managed from the client JavaScript. This takes advantage of the client's (browser) access to the Client API:

The podcast application episode page has a button that the user can select to cause the episode's MP3 file to be stored offline. This is part of the listen-later functionality, something I love to use in the Stitcher app!
The following example code is a function that is executed when the user clicks the Listen Later button on an episode ...
Read now
Unlock full access