Closed Juraj-Masiar closed 1 month ago
Describe the bug In the example:
// Create memory cache synchronously const memoryCache = createCache(memoryStore(), { max: 100, ttl: 10 * 1000 /*milliseconds*/, });
The options are passed to the createCache, but not to the memoryStore function! This then means that both "max" and "ttl" options have no effect, since they are both used only by the store.
createCache
memoryStore
Unlike when using async caching, which passes the options to the store: https://github.com/jaredwray/cache-manager/blob/0d5b97d03f5283605a82984dc93803414180df7b/packages/cache-manager/src/caching.ts#L90
caching
@Juraj-Masiar - thanks for finding this and we have updated the docs. Should be published shortly
Describe the bug In the example:
The options are passed to the
createCache
, but not to thememoryStore
function! This then means that both "max" and "ttl" options have no effect, since they are both used only by the store.Unlike when using async
caching
, which passes the options to the store: https://github.com/jaredwray/cache-manager/blob/0d5b97d03f5283605a82984dc93803414180df7b/packages/cache-manager/src/caching.ts#L90