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