In my experience, I have typically used the shared cache setting:
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
My process is to then think about which entities are not expected to change often and those that would benefit from the cache, performance wise, and mark those as @Cacheable
. My practice of using selective entity caching is a learned convention, but I don't fully understand this approach.
Why not cache all entities? When can caching all entities become a detriment? How can I better gauge this to make a more educated decision?
Some of reasons not to cache entities: