Spring Boot Caching
Question Variations
- "Why does `@Cacheable` sometimes appear not to run?"
- "How should cache invalidation relate to writes?"
- "When is a local cache unsafe in a distributed service?"
Why This Is Asked
Caching annotations are concise, but their correctness depends on keys, invalidation, proxying, and distributed deployment behavior.
Key Concepts
@Cacheablereuses a value based on a cache key.@CacheEvictand@CachePutsupport deliberate mutation policies.- Self-invocation bypasses proxy-based cache annotations.
- A multi-instance application needs a shared cache when consistency requires it.
Question Variations
- “Why does
@Cacheablesometimes appear not to run?” - “How should cache invalidation relate to writes?”
- “When is a local cache unsafe in a distributed service?”