Redis can be used as a cache storage engine within Spring(boot) applications. However, it only allows to set an overall maxmemory size limit. Is there a way to restrict individual RedisCaches in their size, either by number of elements or number of bytes stored in that (sub-)cache?
Is there any wrapper-library that provides such functionality? Or is there perhaps an interface one could implement to easily achieve something like this?
2
Answers
You should write your own redis jar maintaining these restrictions and provide an interface to your main project. This will give you much more flexibility
Yes, you can achieve the same. I would suggest you use the Redisson client for this purpose.