diff --git a/website/astro.config.mjs b/website/astro.config.mjs index aa0f185e..646a3b3c 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -31,6 +31,27 @@ export default defineConfig({ mdx(options), tailwind(), AstroPWA({ + registerType: 'autoUpdate', + injectRegister: 'auto', + workbox: { + globPatterns: ['**/*.{js,css,html,ico,png,svg,json,wav,mp3,ogg}'], + runtimeCaching: [ + { + urlPattern: /^https:\/\/raw\.githubusercontent\.com\/.*/i, + handler: 'CacheFirst', + options: { + cacheName: 'github-files', + expiration: { + maxEntries: 200, + maxAgeSeconds: 60 * 60 * 24 * 30, // <== 14 days + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, + ], + }, devOptions: { enabled: true, },