NOTE
Using Spring Boot Cache Support
Spring cache abstraction usage, cache annotations, cache keys, invalidation, and the limits of local or remote cache providers.
This is a historical learning note and may contain outdated or incomplete understanding.
Spring’s cache abstraction lets application code declare caching around method calls with annotations such as @Cacheable, @CachePut, and @CacheEvict, while the configured CacheManager chooses the actual provider.
A cache key is part of the data contract: include every input that changes the result and avoid accidental collisions. Define expiration/invalidation deliberately rather than assuming cached data remains correct forever.
Proxy-based interception means ordinary self-invocation can bypass cache advice. Caching also does not make a non-idempotent method safe to skip; only cache results whose semantics permit reuse.