Improved initial loading. Uses on device cach first

This commit is contained in:
2026-01-30 17:47:08 -06:00
parent c38892b1ae
commit 40f09b796f
2 changed files with 60 additions and 14 deletions
+23 -2
View File
@@ -20,12 +20,33 @@ export default defineConfig({
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
type: 'image/png',
purpose: 'any maskable'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png'
type: 'image/png',
purpose: 'any maskable'
}
]
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/pocketbase\.ccllc\.pro\/api\/.*/i,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 7 // 1 week
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
}