Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

pwa clear cache

if ('serviceWorker' in navigator) {
  caches.keys().then(function(cacheNames) {
    cacheNames.forEach(function(cacheName) {
      caches.delete(cacheName);
    });
  });
}
Comment

pwa clear cache

self.addEventListener('activate', function(event) {
  event.waitUntil(
    caches.keys().then(function(cacheNames) {
      return Promise.all(
        cacheNames.filter(function(cacheName) {
          // Return true if you want to remove this cache,
          // but remember that caches are shared across
          // the whole origin
        }).map(function(cacheName) {
          return caches.delete(cacheName);
        })
      );
    })
  );
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: check property exists in object javascript 
Javascript :: object assign in javascript 
Javascript :: vuejs on route scrollbehavior 
Javascript :: create record mongoose model 
Javascript :: jsonplaceholder typicode 
Javascript :: express get raw query 
Javascript :: onscroll load more in vue native 
Javascript :: react native mock 
Javascript :: two days before in moment 
Javascript :: react-bootstrap-table2-editor 
Javascript :: google script new date 
Javascript :: proxy api javascript set 
Javascript :: add spinner angular 13 loading 
Javascript :: javascript line chart 
Javascript :: Truncate a string using javascript 
Javascript :: reactstrap search bar 
Javascript :: nextjs local storage 
Javascript :: concat keys json 
Javascript :: Image resize using html and javascript 
Javascript :: js background color 
Javascript :: hashnode 
Javascript :: reverse string 
Javascript :: nestjs queues 
Javascript :: next js latest 
Javascript :: modify array js 
Javascript :: how to sent react from data in mongodb 
Javascript :: form changes button enable reactive forms 
Javascript :: apply css to shadow dom 
Javascript :: nestjs prisma 
Javascript :: concate array to string javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =