Use solution worker
Following a managed web web page kicks from the registration procedure, why don’t we shift to the level of view of this solution worker script, which handles the install occasion.
For the essential example that is basic you’ll want to determine a callback for the install event and determine which files you need to cache.
Inside of our install callback, we have to take the next actions:
- Start a cache.
- Cache our files.
- Verify whether most of the necessary assets are cached or perhaps not.
right Here you can observe we call caches.open() with your desired cache title, and after that we call cache.addAll() and pass inside our variety of files. More