From 70141a30e16f20d84d94f66e1287eb9b805e644e Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 24 Apr 2024 11:48:24 +0100 Subject: [PATCH] Remove unused cache, precache pyright-main*.js --- vite.config.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index c757d6ead..6195518c9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -58,7 +58,7 @@ export default defineConfig(({ mode }) => { workbox: { // Ignore all language related assets and cache these at runtime instead. globIgnores: [ - "**/{pyright*.js,typeshed*.js,search.worker*.js,ui*.js}", + "**/{pyright-locale*.js,typeshed*.js,search.worker*.js,ui*.js}", ], maximumFileSizeToCacheInBytes: 3097152, globPatterns: ["**/*.{js,css,html,ico,png,svg,gif,hex}"], @@ -106,23 +106,6 @@ export default defineConfig(({ mode }) => { }, }, }, - // This doesn't work. - // It doesn't work if you have runtime fetching of the simulator and it's js files either. - // We cache everything in this case, but don't use the cache as the iframe is likely isolated. - { - urlPattern: /^https:\/\/python-simulator.usermbit.org\/.*/, - handler: "CacheFirst", - options: { - cacheName: "sim-cache", - expiration: { - maxEntries: 10, - maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days - }, - cacheableResponse: { - statuses: [0, 200], - }, - }, - }, { urlPattern: /.*.js/, handler: "CacheFirst",