This commit is contained in:
2025-07-14 21:08:21 +02:00
parent 2cf306ee8c
commit 431966d498
17 changed files with 1856 additions and 1442 deletions

View File

@ -15,6 +15,7 @@ const CORE_ASSETS = [
const DYNAMIC_ASSETS_PATTERNS = [
/\/src\/.+\.(ts|tsx|js|jsx)$/,
/\/src\/.+\.css$/,
/\/assets\/.+\.(js|css)$/,
/fonts\.googleapis\.com/,
/fonts\.gstatic\.com/
];
@ -30,6 +31,10 @@ self.addEventListener('install', event => {
}),
caches.open(DYNAMIC_CACHE).then(cache => {
console.log('Dynamic cache initialized');
// Pre-cache critical assets if they exist
return cache.addAll([]).catch(() => {
console.log('No additional assets to pre-cache');
});
})
]).then(() => {
console.log('Service Worker installed successfully');