Hallo,
We have a requirement to set a time to live for all the redis cache keys that starts with a paticular namespace in our java spring application
Key format is "abc:xyz:12345.." and we would like to set a default TTL on all the keys that start with the namespace "abc". The namespace is programatically built.
Now from what I have read, the notion of setting a default TTL does not exist in Redis and we must set it for every key seperately.
But is there a place ( for example in the RedisTemplate or RedisCaheManger etc) where we could configure it so that every key is created with a default ttl instead of -1
We tried some approaches with Redis Cache Manager and Keyspace settings ( keyspaceSettings.setTimeToLive(long)) but were unsuccessful
Can it be used to set the TTL of all the keys generated or are they referring to setting the "cache" expiry and not the "key" expiry here.
Would greatly appreciate if any has tried to implement a default TTL or if you have an approach we could try out.
Thanks a lot!
Julie