From efa7fd5cdbbbd157860a124adcc1266c3309fa4d Mon Sep 17 00:00:00 2001 From: Alexander Harding Date: Tue, 18 Aug 2026 19:40:31 -0500 Subject: [PATCH] fix: cache open-meteo and timezone requests for offline use --- vite.config.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 45a51af..1d5bd63 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -52,15 +52,26 @@ export default defineConfig(() => { }, { handler: "NetworkFirst", - urlPattern: /\/api\/weather.*/, + urlPattern: /\/api\/openmeteo.*/, options: { - cacheName: "apiWeatherCache", + cacheName: "apiOpenMeteoCache", expiration: { maxEntries: 100, maxAgeSeconds: 60 * 60 * 4, // 4 Hours }, }, }, + { + handler: "NetworkFirst", + urlPattern: /\/api\/timezone.*/, + options: { + cacheName: "apiTimezoneCache", + expiration: { + maxEntries: 100, + maxAgeSeconds: 60 * 60 * 24 * 7, // 7 Days + }, + }, + }, { handler: "NetworkFirst", urlPattern: /\/api\/tfr.*/,