Skip to content

Commit

Permalink
Remove unused cache, precache pyright-main*.js
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Apr 24, 2024
1 parent 088bf8f commit 70141a3
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}"],
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 70141a3

Please sign in to comment.