diff --git a/package.json b/package.json index b7cd21e..822080b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pojazdownik", - "version": "1.8.1", + "version": "1.8.2", "private": true, "type": "module", "scripts": { diff --git a/vite.config.ts b/vite.config.ts index a113b88..0cd1068 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,7 +24,7 @@ export default defineConfig({ runtimeCaching: [ { urlPattern: /^https:\/\/rj.td2.info.pl\/dist\/img\/thumbnails\/.*/i, - handler: 'NetworkFirst', + handler: 'CacheFirst', options: { cacheName: 'swdr-images-cache', expiration: { @@ -37,10 +37,24 @@ export default defineConfig({ }, }, { - urlPattern: /^https:\/\/spythere.github.io\/api\/td2\/.*/i, + urlPattern: /^https:\/\/spythere.github.io\/api\/td2\/data\/.*/i, handler: 'NetworkFirst', options: { - cacheName: 'spythere-api-cache', + cacheName: 'spythere-api-data-cache', + expiration: { + maxEntries: 150, + maxAgeSeconds: 60 * 60 * 24, // <== 1 day + }, + cacheableResponse: { + statuses: [0, 200], + }, + }, + }, + { + urlPattern: /^https:\/\/spythere.github.io\/api\/td2\/images\/.*/i, + handler: 'CacheFirst', + options: { + cacheName: 'spythere-api-images-cache', expiration: { maxEntries: 150, maxAgeSeconds: 60 * 60 * 24, // <== 1 day