Creating our first Progressive Web Application

Creating our first Progressive Web Application

Important Note and link to whole Project:
You can also use PROMISES in your activation events.Using promises while deleting the cache is more effective.Here is the same code using promises to delete old cache during the activation:

Source code:
PS:Mind the equals to and arrow sign.You know where to change 🙂

self.addEventListener(‘activate’,event={ //change equalto with arrow
caches.keys() //provide the name of all caches
.then(cacheNames={ //change equal to with arrow
return Promise.all({ //change equal to with arrow
if(cache != ourcachename){“Deleting old cache”,cache)
return caches.delete(cache);
return self.clients.claim();
Link to whole project:

Leave a Reply

Your email address will not be published. Required fields are marked *