This commit is contained in:
2022-11-27 15:36:50 +01:00
parent ff93e4cc32
commit 2d64cc1f5c
+19 -19
View File
@@ -9,25 +9,25 @@ export default defineConfig({
vue(), vue(),
VitePWA({ VitePWA({
registerType: 'autoUpdate', registerType: 'autoUpdate',
workbox: { // workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,img}'], // globPatterns: ['**/*.{js,css,html,png,svg,img}'],
runtimeCaching: [ // runtimeCaching: [
{ // {
urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`), // urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`),
handler: 'NetworkFirst', // handler: 'NetworkFirst',
options: { // options: {
cacheName: 'github-api-cache', // cacheName: 'github-api-cache',
expiration: { // expiration: {
maxEntries: 400, // maxEntries: 400,
maxAgeSeconds: 60 * 60 * 24 * 30, // <== 30 days // maxAgeSeconds: 60 * 60 * 24 * 30, // <== 30 days
}, // },
cacheableResponse: { // cacheableResponse: {
statuses: [0, 200], // statuses: [0, 200],
}, // },
}, // },
}, // },
], // ],
}, // },
devOptions: { devOptions: {
enabled: true, enabled: true,
}, },