feat(#84): Improve performance and efficiency of service worker

This commit is contained in:
Josh Creek
2026-01-22 21:21:57 +00:00
parent dd9ced17d8
commit c5c63ab8ef
3252 changed files with 280 additions and 21 deletions
+19 -2
View File
@@ -45,10 +45,27 @@ export default defineConfig({
background_color: '#f0f0f0'
},
injectManifest: {
globPatterns: ['client/**/*.{js,css,ico,png,svg,webp,woff,woff2,webmanifest}']
globPatterns: ['client/**/*.{js,css,ico,png,svg,webp,woff,woff2,webmanifest}'],
globIgnores: ['**/sprites/**', '**/sprites-small/**']
},
workbox: {
globPatterns: ['client/**/*.{js,css,ico,png,svg,webp,woff,woff2,webmanifest}']
globPatterns: ['client/**/*.{js,css,ico,png,svg,webp,woff,woff2,webmanifest}'],
globIgnores: ['**/sprites/**', '**/sprites-small/**'],
runtimeCaching: [
{
urlPattern: ({ request }) => request.destination === 'image',
handler: 'CacheFirst',
options: {
cacheName: 'image-cache',
cacheableResponse: { statuses: [0, 200] },
expiration: {
maxEntries: 3000,
maxAgeSeconds: 60 * 60 * 24 * 30,
purgeOnQuotaError: true
}
}
}
]
},
devOptions: {
enabled: false,