essais
This commit is contained in:
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user