7 lines
225 B
TypeScript
7 lines
225 B
TypeScript
import { LRUCache } from 'lru-cache'
|
||
|
||
export const authCache = new LRUCache<string, any>({
|
||
max: 10000, // 最大缓存数量
|
||
ttl: 1000 * 60 * 60 * 24 * 7, // 缓存过期时间,单位为毫秒,这里设置为7天
|
||
});
|