#CacheModule / Which ttl will be used?

4 messages · Page 1 of 1 (latest)

balmy moon
#

so the ttl of cachemodule, will it affect the redis store, and which ttl will be used by cacheablememory?

proven halo
#

Yeah, I wondered this too....

In my case I have an persistent cache that needs manual eviction ( for some endpoints ), valkey and a valkey memory cache.

Fallback cache documentation isn't very comprehensive.

proven halo
sterile plover
#

Just to be clear, the cache-manager is a different package than cacheable and has no real clue about primary or secondary cache. The first cache in the stores array is considered the default for use with the cache interceptor. Otherwise, you have to inject the cache manager and use your own logic to use each cache individually, as you need them. It seems, the only way to get a particular store is via the stores array.

The ttl property is a default or rather should be considered the max ttl. If you add a ttl to the store that is shorter, then that overrides the default ttl. If you add an even shorter ttl to the set command, that overrides all of them. I've not tested the "max ttl", so it is theory on my part. But, for sure there should be overrides and for sure you should be thinking of the default as a maximum.