Service Worker Precache is a module for generating a service worker that precaches resources. The module can be used in JavaScript-based build scripts, like those written with gulp, and it also provides a command-line interface. You can use the module directly, or if you'd prefer, use of the wrappers around sw-precache for specific build environments, like webpack.
It can be used alongside the sw-toolbox library, which works well when following the App Shell + dynamic content model.