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.
This commit is contained in:
KernelDeimos
2025-09-14 03:24:40 -04:00
parent 733b6a653e
commit f3fdfea65b

View File

@@ -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