From eb47cdf0161e76dda63fd2d676d0613ada6978c4 Mon Sep 17 00:00:00 2001 From: Timon Ostertun Date: Wed, 30 Sep 2020 22:25:59 +0200 Subject: [PATCH] RA-#7 Removed unnecessary files from cache --- service-worker.js.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/service-worker.js.php b/service-worker.js.php index 0f52f7f..e4c2322 100644 --- a/service-worker.js.php +++ b/service-worker.js.php @@ -56,15 +56,19 @@ workbox.precaching.precacheAndRoute([ '/manifest.json.php', ]; $dirsToCache = [ - '/client', + '/client/app', + '/client/fonts/css', + '/client/fonts/webfonts' + '/client/images' + '/client/scripts' + '/client/styles' ]; function addDir($path) { global $filesToCache; if ($dir = opendir(__DIR__ . $path)) { while (($file = readdir($dir)) !== false) { - if ($file == '.') continue; - if ($file == '..') continue; + if (substr($file, 0, 1) == '.') continue; if (is_dir(__DIR__ . $path . '/' . $file)) { addDir($path . '/' . $file); } else {