RA-#7 Removed unnecessary files from cache

This commit is contained in:
Timon Ostertun
2020-09-30 22:25:59 +02:00
parent 12c1a614bb
commit eb47cdf016

View File

@@ -56,15 +56,19 @@ workbox.precaching.precacheAndRoute([
'/manifest.json.php', '/manifest.json.php',
]; ];
$dirsToCache = [ $dirsToCache = [
'/client', '/client/app',
'/client/fonts/css',
'/client/fonts/webfonts'
'/client/images'
'/client/scripts'
'/client/styles'
]; ];
function addDir($path) { function addDir($path) {
global $filesToCache; global $filesToCache;
if ($dir = opendir(__DIR__ . $path)) { if ($dir = opendir(__DIR__ . $path)) {
while (($file = readdir($dir)) !== false) { while (($file = readdir($dir)) !== false) {
if ($file == '.') continue; if (substr($file, 0, 1) == '.') continue;
if ($file == '..') continue;
if (is_dir(__DIR__ . $path . '/' . $file)) { if (is_dir(__DIR__ . $path . '/' . $file)) {
addDir($path . '/' . $file); addDir($path . '/' . $file);
} else { } else {