From f3fdfea65b37783ce9bb8817e91e33969192a480 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Sun, 14 Sep 2025 03:24:40 -0400 Subject: [PATCH] perf: add 30 second app cache There used to be an app cache here that would be invalidated but I think this may have been removed because the invalidation logic was causing issues. A 30 second cache seems reasonable though, so let's do that for now. --- src/backend/src/helpers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/src/helpers.js b/src/backend/src/helpers.js index 6cacc773..ea893316 100644 --- a/src/backend/src/helpers.js +++ b/src/backend/src/helpers.js @@ -365,6 +365,10 @@ async function refresh_associations_cache(){ app = app && app[0] ? app[0] : null; if ( app === null ) return null; + + kv.set(`apps:uid:${app.uid}`, app, { EX: 30 }); + kv.set(`apps:name:${app.name}`, app, { EX: 30 }); + kv.set(`apps:id:${app.id}`, app, { EX: 30 }); // shallow clone because we use the `delete` operator // and it corrupts the cache otherwise