@Cacheable Articles
2 articles about @Cacheable. Explore Spring Boot implementation, design, and operations across related topics.
-
Why @Transactional, @Cacheable, and @Async Don't Work in Spring Boot - Understanding AOP Proxies and Self-Invocation to Fix It
@Transactional doesn't roll back, @Cacheable hits the DB every time, @Async runs synchronously. All of these are caused by how Spring AOP proxies work. This article isolates five patterns - self-invocation, private/final methods, new, and missing enablement - with reproducible code and diagnostic steps, then compares workarounds such as extracting to a separate Bean, self-injection, and TransactionTemplate.
-
How to Use Spring Boot Caching - Easy Performance Improvements with @Cacheable
A hands-on guide covering how Spring Cache Abstraction works, how to use @Cacheable, @CacheEvict, and @CachePut, switching to Caffeine and Redis, and measuring hit rates with Micrometer, all with practical code examples. Aimed at beginner-to-intermediate developers who want to fix response latency caused by redundant DB or external API calls with just a few lines of annotations.