Optimize multi-model caching and frontend revalidation

This commit is contained in:
2569718930@qq.com
2026-05-20 08:58:16 +08:00
parent 1af33c3ab8
commit 72e93f8e93
7 changed files with 78 additions and 6 deletions
+2 -2
View File
@@ -518,8 +518,8 @@ export const dashboardClient = {
meta: Record<string, CityCacheMeta>,
) {
if (!isClient()) return;
// Keep only the 3 most-recently-accessed cities to prevent sessionStorage bloat
const MAX_CACHED_CITIES = 3;
// Keep only the 12 most-recently-accessed cities to prevent sessionStorage bloat
const MAX_CACHED_CITIES = 12;
const allEntries = Object.entries(details).map(([cityName, detail]) => ({
cityName,
cachedAt: meta[cityName]?.cachedAt || 0,