From 5b5c53bebc64613c055e78468c10e6c58e2d92a1 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Fri, 21 Nov 2025 15:02:42 +0530 Subject: [PATCH] chore: added runtime caching for PWA --- frontend/vite.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 980a6171..4ce43fea 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -34,6 +34,16 @@ export default defineConfig({ maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, globDirectory: '/assets/lms/frontend', globPatterns: ['**/*.{js,css,html,png,svg,woff2}'], + runtimeCaching: [ + { + urlPattern: ({ request }) => + request.destination === 'document', + handler: 'NetworkFirst', + options: { + cacheName: 'html-cache', + }, + }, + ], }, manifest: false, }),