July 2018
Intermediate to advanced
354 pages
8h 51m
English
The activate event is the next part of the service worker life cycle chain that you can leverage to manage cached assets. It can also be used to cache assets, but is more commonly used to perform cache model cleanup.
Instead of focusing on caching assets, the activate event is better suited to clean up legacy caches. This can eliminate version mismatch issues that can break your application:

To implement this strategy, you need to have a discernible version cache-naming convention. I recommend adding a version number to all of your named caches. This gives you a simple pattern that you can match to determine whether a named cache ...
Read now
Unlock full access