An universal service worker for meteor apps
Meteor.startup(() => { navigator.serviceWorker.register('/sw.js') .then() .catch(error => console.log('ServiceWorker registration failed: ', error)); });
Service Workers are only available to secure origins. So be sure your server has https (localhost is considered as secure). And that the website you made request to are considered as secure. So your subdomain or your CDN must have HTTPS enabled.file.js?hash=XXX
where XXX is the hash. Thanks to this hash the SW knows if the cache has the latest version or if it has to make a network request.No, service workers are for caching assets (images, videos, js, css etc.)
I do not use Meteor anymore. If an active user wants to be a maintainer I might consider him/her.
List of cached files are in Application -> Cache Storate
To debug the SW script, go to chrome://serviceworker-internals/
and check Open Dev Tools ...
which will start the Service Worker in its own Developer Tools
Every modern browsers support Service Workers. Support can be check at caniuse.com