switch to lru in memory cache and dont cache failed sessions

This commit is contained in:
miloschwartz
2026-09-10 16:48:44 -04:00
committed by Owen
parent c7645e5c5b
commit aed325f273
6 changed files with 98 additions and 31 deletions
+2 -8
View File
@@ -1,13 +1,7 @@
import NodeCache from "node-cache";
import logger from "@server/logger";
import { createLocalCache } from "@server/lib/createLocalCache";
// Create local cache with maxKeys limit to prevent memory leaks
// With ~10k requests/day and 5min TTL, 10k keys should be more than sufficient
export const localCache = new NodeCache({
stdTTL: 3600,
checkperiod: 120,
maxKeys: 10000
});
export const localCache = createLocalCache();
// Log cache statistics periodically for monitoring
// setInterval(() => {