Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix: Optimize cache handling in flows.js to reduce latency

udvkd1010ff3d7c3
diff --git a/api/galaxy/flows.js b/api/galaxy/flows.js
index 94ffbb67e..2f6a04390 100644
--- a/api/galaxy/flows.js
+++ b/api/galaxy/flows.js
@@ -270,7 +270,12 @@ export default async function handler(req, res) {
let body = await cacheGet(cacheKey);
if (body === null) {
body = await buildWithDeadline();
- await cacheSet(cacheKey, body, FEED_TTL_S);
+ // Fire-and-forget: the body is already in hand and the cache is an
+ // optimization, not part of the result. Awaiting put a degraded Upstash
+ // (SET timing out at REDIS_CMD_TIMEOUT_MS) directly on the request's
+ // critical path — up to 3s of dead latency for a write that falls back to
+ // memory anyway. cacheSet swallows its own errors; .catch is belt-and-braces.
+ cacheSet(cacheKey, body, FEED_TTL_S).catch(() => {});
}
res.setHeader('cache-control', 'public, max-age=6');
return json(res, 200, { data: body });