An in-memory lru cache for typeorm
Basically just a wrapper for lru-cache
Use the provider for the cache when configuring typeorm
import LRUCacheProvider from 'typeorm-lru-cache'
{
...
cache: {
provider: () => {
return new LRUCacheProvider({
max: 1000,
// how long to live in ms
ttl: 20000,
// return stale items before removing from cache?
allowStale: false,
updateAgeOnGet: false,
updateAgeOnHas: false,
});
},
}
}