From 7cabfb10deac9ba7dbc8331b9c0c5c09311168cc Mon Sep 17 00:00:00 2001
From: Scarriffle
Date: Thu, 7 May 2026 19:23:35 +0200
Subject: [PATCH] =?UTF-8?q?perf:=20Event-Cache=20von=20=C2=B18=20Wochen=20?=
=?UTF-8?q?auf=20=C2=B110=20Monate=20erweitern?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Damit lädt beim Swipen durch Monate erst nach ~10 Monaten in beide
Richtungen erneut Daten nach. Vorher reichte der Cache nur ±2 Monate,
sodass nach 2-3 Wischen ein Spinner kam.
- CACHE_BUF 56 → 300 Tage (initial ±10 Monate)
- PREFETCH_EXT 56 → 180 Tage (Verlängerung bei Edge ~6 Monate)
- PREFETCH_EDGE 28 → 90 Tage (Trigger ~3 Monate vor Cache-Rand)
Version v6 → v7.
---
frontend/index.html | 22 +++++++++++-----------
frontend/js/calendar.js | 6 +++---
frontend/js/version.js | 2 +-
frontend/sw.js | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/frontend/index.html b/frontend/index.html
index 6565e70..5233a62 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -4,7 +4,7 @@
- Calendarr v6
+ Calendarr v7
@@ -80,7 +80,7 @@
-
+
@@ -159,7 +159,7 @@
diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js
index 85ace73..267723a 100644
--- a/frontend/js/calendar.js
+++ b/frontend/js/calendar.js
@@ -106,9 +106,9 @@ function handleHAOAuthReturn() {
}
// ── Event cache ───────────────────────────────────────────
-const CACHE_BUF = 56 * 86400000; // initial ±8 weeks
-const PREFETCH_EXT = 56 * 86400000; // extend by 8 weeks when triggered
-const PREFETCH_EDGE = 28 * 86400000; // trigger when within 4 weeks of cache edge
+const CACHE_BUF = 300 * 86400000; // initial ±10 months around the view
+const PREFETCH_EXT = 180 * 86400000; // extend by ~6 months when triggered
+const PREFETCH_EDGE = 90 * 86400000; // trigger when within ~3 months of cache edge
const eventCache = {
start: null, end: null, events: [],
diff --git a/frontend/js/version.js b/frontend/js/version.js
index bc8e7e5..6e19206 100644
--- a/frontend/js/version.js
+++ b/frontend/js/version.js
@@ -1,2 +1,2 @@
// Increment APP_VERSION with every code change
-export const APP_VERSION = 'v6';
+export const APP_VERSION = 'v7';
diff --git a/frontend/sw.js b/frontend/sw.js
index 3e9316e..63e8715 100644
--- a/frontend/sw.js
+++ b/frontend/sw.js
@@ -1,7 +1,7 @@
// Calendarr Service Worker
// Cache-first for static assets, network-first for /api/* (graceful offline)
-const CACHE_VERSION = 'calendarr-v6';
+const CACHE_VERSION = 'calendarr-v7';
const STATIC_ASSETS = [
'/',
'/index.html',