export const platformStatsCacheMiddleware = createMiddleware({ type: "function" }).server(async ({ next, data }) => {
const cacheKey = `platformStats:${JSON.stringify(data ?? null)}`;
// Cached for 24 hours
return getContainer()
.then(c => c.cacheManager.wrap(
cacheKey,
async () => next(),
{ ttl: 24 * 60 * 60 * 1000 },
));
;
});
export const platformStatsCacheMiddleware = createMiddleware({ type: "function" }).server(async ({ next, data }) => {
const cacheKey = `platformStats:${JSON.stringify(data ?? null)}`;
// Cached for 24 hours
return getContainer()
.then(c => c.cacheManager.wrap(
cacheKey,
async () => next(),
{ ttl: 24 * 60 * 60 * 1000 },
));
;
});