From 94c46050844d4faff77ae2d2b17c495160aa8251 Mon Sep 17 00:00:00 2001 From: intergrav Date: Thu, 6 Aug 2026 16:34:45 -0400 Subject: [PATCH] feat: runtimeCaching avoid re-downloading identical album art by caching it (CacheFirst) for 24 hours, if the server doesn't send proper cache-control headers may revert if this ends up being a problem --- vite.config.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 198c734..c765459 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,6 +12,19 @@ export default defineConfig(({ mode }) => { VitePWA({ workbox: { globPatterns: ["**/*.{js,css,html,ico,png,svg}"], + runtimeCaching: [ + { + urlPattern: /\/rest\/getCoverArt/, + handler: "CacheFirst", + options: { + cacheName: "cover-art", + expiration: { + maxEntries: 500, + maxAgeSeconds: 60 * 60 * 24, + }, + }, + }, + ], }, manifest: { name: "tinysub", -- 2.51.2