title: Service worker.js is not updating changes. Only if cache is cleared
body: <p>This is my first PWA app with laravel. This code is working,it gets registered well, but if I do a change in the code, for example in the HTML, it is not getting update, and the console is not throwing errors, and I dont know why.</p>
  
  <p>I'm using this code to call the service-worker.js</p>
  
  <pre><code>if ('serviceWorker' in navigator ) {
  window.addEventListener('load', function() {
      navigator.serviceWorker.register('/service-worker.js').then(function(registration) {
          // Registration was successful
          console.log('ServiceWorker registration successful with scope: ', registration.scope);
      }, function(err) {
          // registration failed :(
          console.log('ServiceWorker registration failed: ', err);
      });
  });
  </code></pre>
  
  <p>}</p>
  
  <p>And this is the code of the sw.js</p>
  
  <pre><code>var cache_name = 'SW_CACHE';
  var urlsToCache = [
  '/',
  '/register'
  ];
  self.addEventListener('install', function(event) {
      event.waitUntil(precache());
  });
  addEventListener('fetch', function(event) {
      event.respondWith(
      caches.match(event.request)
          .then(function(response) {
          // Cache hit - return response
          if (response) {
              return response;
          }
          var fetchRequest = event.request.clone();
          return fetch(fetchRequest).then(
              function(response) {
              // Check if we received a valid response
              if(!response || response.status !== 200 || response.type !== 'basic') {
                  return response;
              }
              var responseToCache = response.clone();
              caches.open(cache_name)
                  .then(function(cache) {
                  cache.put(event.request, responseToCache);
                  });
              return response;
              }
          );
          })
      );
  });
  var fromCache = function (request) {
      return caches.open(cache_name).then(function (cache) {
      cache.match(request).then(function (matching) {
          return matching || Promise.resolve('no-match');
      });
      });
  }
  var update = function (request) {
      return caches.open(cache_name).then(function (cache) {
      return fetch(request).then(function (response) {
          return cache.put(request, response);
      });
      });
  }
  var precache = function() {
      return caches.open(cache_name).then(function (cache) {
      return cache.addAll(urlsToCache);
      });
  }
  </code></pre>
  
  <p>Y also used skipWaiting(); method inner Install method, but it crash my app and have to unload the sw from chrome://serviceworker-internals/</p>