+9
-8
frontend/src/lib/components/BufoEasterEgg.svelte
+9
-8
frontend/src/lib/components/BufoEasterEgg.svelte
···
58
58
}
59
59
60
60
async function fetchBufos() {
61
-
// check cache first
62
-
const cached = getCached(query);
63
-
if (cached) {
64
-
bufos = cached;
65
-
return;
66
-
}
67
-
68
61
try {
69
62
// get patterns from props or config
70
63
let exclude = excludePatterns;
···
73
66
const config = await getServerConfig();
74
67
exclude = config.bufo_exclude_patterns ?? [];
75
68
include = config.bufo_include_patterns ?? [];
69
+
}
70
+
71
+
// cache key includes patterns so config changes invalidate cache
72
+
const cacheKey = `${query}|${exclude.sort().join(',')}|${include.sort().join(',')}`;
73
+
const cached = getCached(cacheKey);
74
+
if (cached) {
75
+
bufos = cached;
76
+
return;
76
77
}
77
78
78
79
const params = new URLSearchParams({
···
91
92
const data = await response.json();
92
93
bufos = data.results || [];
93
94
if (bufos.length > 0) {
94
-
setCache(query, bufos);
95
+
setCache(cacheKey, bufos);
95
96
}
96
97
}
97
98
} catch (e) {