From f4f9a4729ffe5057d765874b239fc171771ae53d Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 8 Mar 2024 16:54:08 +0100 Subject: [PATCH 1/2] poprawki cachowania --- vite.config.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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 From f9276f6c716888c240e8e104ab8147a8c724bfed Mon Sep 17 00:00:00 2001 From: Spythere Date: Fri, 8 Mar 2024 16:54:30 +0100 Subject: [PATCH 2/2] bump: 1.8.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {