From eae410304bf982c17f4e20f1a2d208b6c45bf25f Mon Sep 17 00:00:00 2001 From: IzioDev <9900846+IzioDev@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:33:14 +0200 Subject: [PATCH 1/4] chore(web): vite pwa cache policy tweak --- vite.config.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index cc084644..8a43e723 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -78,6 +78,34 @@ const webPlugins: PluginOption[] = [ workbox: { // 14 mb maximumFileSizeToCacheInBytes: 14000000, + cleanupOutdatedCaches: true, + skipWaiting: true, + clientsClaim: true, + runtimeCaching: [ + // Navigations (index.html) + { + urlPattern: ({ request, sameOrigin }) => + sameOrigin && request.mode === "navigate", + handler: "NetworkFirst", + options: { + cacheName: "html-pages", + networkTimeoutSeconds: 5, + }, + }, + // JS/CSS/Workers + { + urlPattern: ({ request }) => + ["script", "style", "worker"].includes(request.destination), + handler: "StaleWhileRevalidate", + options: { cacheName: "assets" }, + }, + // Images + { + urlPattern: ({ request }) => request.destination === "image", + handler: "StaleWhileRevalidate", + options: { cacheName: "images" }, + }, + ], }, }), ]; From ba6670f47d72d1866a580007d60cd74117b0f230 Mon Sep 17 00:00:00 2001 From: IzioDev <9900846+IzioDev@users.noreply.github.com> Date: Sun, 12 Oct 2025 23:00:34 +0200 Subject: [PATCH 2/4] chore: use cf cache policy --- public/_headers | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 public/_headers diff --git a/public/_headers b/public/_headers new file mode 100644 index 00000000..afb43aaf --- /dev/null +++ b/public/_headers @@ -0,0 +1,26 @@ +/ + Cache-Control: no-cache, no-store, must-revalidate + Pragma: no-cache + Expires: 0 + +/index.html + Cache-Control: no-cache, no-store, must-revalidate + Pragma: no-cache + Expires: 0 + +/*.html + Cache-Control: no-cache, no-store, must-revalidate + Pragma: no-cache + Expires: 0 + +/assets/* + Cache-Control: public, max-age=31536000, immutable + +/*.webmanifest + Cache-Control: no-cache + +/sw.js + Cache-Control: no-cache + +/workbox-*.js + Cache-Control: no-cache From 11391a82dc144d583f2ee27d650506618f9e8dc0 Mon Sep 17 00:00:00 2001 From: IzioDev <9900846+IzioDev@users.noreply.github.com> Date: Mon, 13 Oct 2025 06:39:04 +0200 Subject: [PATCH 3/4] fix: re-introduce vite react basic --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c634dc1..7cf75702 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kasia", - "version": "0.6.1", + "version": "0.6.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kasia", - "version": "0.6.1", + "version": "0.6.2", "dependencies": { "@headlessui/react": "2.2.1", "@tailwindcss/vite": "4.1.3", @@ -41,7 +41,7 @@ "@types/react": "19.1.0", "@types/react-dom": "19.1.4", "@types/uuid": "^10.0.0", - "@vitejs/plugin-react": "^4.5.1", + "@vitejs/plugin-react": "^4.7.0", "@vitest/browser": "^3.2.4", "autoprefixer": "^10.4.21", "babel-plugin-react-compiler": "^19.1.0-rc.2", @@ -3783,9 +3783,9 @@ } }, "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-beta.19", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.19.tgz", - "integrity": "sha512-3FL3mnMbPu0muGOCaKAhhFEYmqv9eTfPSJRJmANrCwtgK8VuxpsZDGK+m0LYAGoyO8+0j5uRe4PeyPDK1yA/hA==", + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", "dev": true, "license": "MIT" }, @@ -5691,16 +5691,16 @@ } }, "node_modules/@vitejs/plugin-react": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.6.0.tgz", - "integrity": "sha512-5Kgff+m8e2PB+9j51eGHEpn5kUzRKH2Ry0qGoe8ItJg7pqnkPrYPkDQZGgGmTa0EGarHrkjLvOdU3b1fzI8otQ==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.27.4", + "@babel/core": "^7.28.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-beta.19", + "@rolldown/pluginutils": "1.0.0-beta.27", "@types/babel__core": "^7.20.5", "react-refresh": "^0.17.0" }, @@ -5708,7 +5708,7 @@ "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, "node_modules/@vitest/browser": { diff --git a/package.json b/package.json index 49c98cf5..4352d64e 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "@types/react": "19.1.0", "@types/react-dom": "19.1.4", "@types/uuid": "^10.0.0", - "@vitejs/plugin-react": "^4.5.1", + "@vitejs/plugin-react": "^4.7.0", "@vitest/browser": "^3.2.4", "autoprefixer": "^10.4.21", "babel-plugin-react-compiler": "^19.1.0-rc.2", From ec75310599608ef2637521c323fc83e58c0124d5 Mon Sep 17 00:00:00 2001 From: IzioDev <9900846+IzioDev@users.noreply.github.com> Date: Sat, 25 Oct 2025 10:54:15 +0200 Subject: [PATCH 4/4] review: cache svg and png --- public/_headers | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/_headers b/public/_headers index afb43aaf..5e576f21 100644 --- a/public/_headers +++ b/public/_headers @@ -24,3 +24,9 @@ /workbox-*.js Cache-Control: no-cache + +/*.png + Cache-Control: public, max-age=604800 + +/*.svg + Cache-Control: public, max-age=604800