Skip to content

Commit

Permalink
cache!
Browse files Browse the repository at this point in the history
  • Loading branch information
ukstv committed Mar 12, 2024
1 parent 1c360c0 commit 732aae8
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions examples/example-vite/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,46 @@ export default defineConfig({
plugins: [
react(),
topLevelAwait(),
// VitePWA({
// registerType: "autoUpdate",
// }),
VitePWA({
registerType: "autoUpdate",
workbox: {
runtimeCaching: [
{
urlPattern: /^https:\/\/swrd\.ukstv\.me\/.*/i,
handler: "CacheFirst",
options: {
cacheName: "skyward-cache",
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
maximumFileSizeToCacheInBytes: 20971520, // 20MiB
},
}),
],
worker: {
format: "es",
rollupOptions: {
output: {
manualChunks: {
o1js: ["o1js"],
},
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
host: '0.0.0.0',
host: "0.0.0.0",
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
Expand Down

0 comments on commit 732aae8

Please sign in to comment.