title: Service Worker Cache
body: <p>I have the following code wich it should cache 3 files but wen I reload the page and I enter dev tool and network it says that all my files are from service worker.It my code correct and only those 3 files are catched or all the file are catched?</p>
  
  <pre><code>let cache_name = 'v1'
  let cache_files = [
   './style/general.css',
   './style/authenticate.css',
  './javascript/app.js'
  ];
  
  
  self.addEventListener('install',function(e){
     console.log('[ServiceWorker] installed')
     e.waitUntil(
      caches.open(cache_name).then(function(cache){
      console.log('[ServiceWorker] Caching ',cache_files)
       return cache.addAll(cache_files)
    })
   )
  });
  
  self.addEventListener('activate',function(e){
    console.log('[ServiceWorker] activated')
    e.waitUntil(
      caches.keys().then(function(cache_names){
         return Promise.all(cache_names.map(function(this_cache_name){
           if(this_cache_name !== cache_name){
             console.log('[ServiceWorker] removing cached files      from',this_cache_name)
        return caches.delete(this_cache_name)
       }
      }))
     })
   )
  })
  
  self.addEventListener('fetch',function(e){
     e.respondWith(
       caches.match(e.request).then(function(response) {
          return response || fetch(e.request);
    })
   );
  })
  </code></pre>
  
  <p>And how can I tell which files are cached and which one are not?</p>