@@ -30,7 +30,8 @@ export default defineConfig({
3030 VitePWA ( {
3131 registerType : "autoUpdate" ,
3232 workbox : {
33- globPatterns : [ "**/*.{js,css,html,ico,png,svg}" ] ,
33+ globPatterns : [ "**/*.{js,css,html,ico}" ] ,
34+ globIgnores : [ "**/images/characters/**" ] ,
3435 runtimeCaching : [
3536 {
3637 urlPattern : / ^ h t t p s : \/ \/ f o n t s \. g o o g l e a p i s \. c o m \/ .* / i,
@@ -43,6 +44,28 @@ export default defineConfig({
4344 } ,
4445 } ,
4546 } ,
47+ {
48+ urlPattern : / \/ i m a g e s \/ c h a r a c t e r s \/ .* \. p n g $ / ,
49+ handler : "CacheFirst" ,
50+ options : {
51+ cacheName : "character-images-cache" ,
52+ expiration : {
53+ maxEntries : 100 , // Cache most-used characters
54+ maxAgeSeconds : 60 * 60 * 24 * 30 , // 30 days
55+ } ,
56+ } ,
57+ } ,
58+ {
59+ urlPattern : / \/ i m a g e s \/ s t a g e s \/ .* \. p n g $ / ,
60+ handler : "CacheFirst" ,
61+ options : {
62+ cacheName : "stage-images-cache" ,
63+ expiration : {
64+ maxEntries : 50 , // All stages
65+ maxAgeSeconds : 60 * 60 * 24 * 365 , // 1 year
66+ } ,
67+ } ,
68+ } ,
4669 ] ,
4770 } ,
4871 includeAssets : [ "favicon.ico" , "logo192.png" , "logo512.png" ] ,
0 commit comments