feat: implement local caching for vCon data

Persist clients, storage stats, and file lists in local cache to improve initial load performance. Added breadcrumb navigation to the AdminPageHeader.
This commit is contained in:
Team Dark Devil committed 2026-11-16 23:10:44 +06:00
1 parent b42029f67d
commit 1a1c19d7bb
25 files changed
+892 -342

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// In-memory Stale-While-Revalidate (SWR) cache for VCON Admin Control Panel views.
// Ensures 0ms instant state hydration when navigating across /vcon/* routes while
// silently refreshing live telemetry, clients, storage, settings, and profile data in the background.
const memoryStore = new Map<string, unknown>();
export function getCached<T>(key: string, fallback: T): T {
if (memoryStore.has(key)) {
return memoryStore.get(key) as T;
}
return fallback;
}
export function setCached<T>(key: string, value: T): T {
memoryStore.set(key, value);
return value;
}