October 2017
Intermediate to advanced
370 pages
8h 57m
English
Starting with the service worker from the last example, there's not too much to do here. We just need to specify the PWA resources that we want to cache. Since the PWA page won't be an AMP page this time, let's also cache a JavaScript file that the PWA uses. To do this, we can just modify the previous service worker code like this (/ch11/amptopwa/sw.js):
return cache.addAll(['pwa.html', 'style.css', 'pwa.js']);
Read now
Unlock full access