Jasper van Merle 6 years ago
parent
commit
0b1adb5291
1 changed files with 1 additions and 1 deletions
  1. 1 1
      views/service-worker.js.erb

+ 1 - 1
views/service-worker.js.erb

@@ -50,7 +50,7 @@ self.addEventListener('fetch', event => {
       <%# The index page will make sure the correct documentation or a proper offline page is shown  %>
       <%# The index page will make sure the correct documentation or a proper offline page is shown  %>
       const pathname = url.pathname;
       const pathname = url.pathname;
       const filename = pathname.substr(1 + pathname.lastIndexOf('/')).split(/\#|\?/g)[0];
       const filename = pathname.substr(1 + pathname.lastIndexOf('/')).split(/\#|\?/g)[0];
-      if (url.origin === location.origin && !filename.includes('.')) {
+      if (url.origin === location.origin && !['.css', '.js', '.json', '.png', '.ico', '.svg', '.xml'].some(ext => filename.endsWith(ext))) {
         const cachedIndex = await caches.match('/');
         const cachedIndex = await caches.match('/');
         if (cachedIndex) return cachedIndex;
         if (cachedIndex) return cachedIndex;
       }
       }