Caffeine Articles
3 articles about Caffeine. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Control Cache Keys with @Cacheable in Spring Boot - Choosing Between SpEL in the key Attribute, KeyGenerator, condition/unless, and @Caching
You added @Cacheable, yet different arguments return the same result, or null values end up cached. This guide covers Spring Boot 3.x: the key resolution rules of SimpleKeyGenerator, SpEL in the key attribute, custom KeyGenerator implementations, condition/unless, and when to use @Caching, and finishes with tests that verify cache keys using Caffeine stats.
-
How to Configure and Tune Caffeine Cache in Spring Boot - From expireAfterWrite and maximumSize to Production Operations with stats()
A practical guide to tuning Caffeine cache per-cache in Spring Boot. Covers the distinction between expireAfterWrite and expireAfterAccess, size management with maximumSize and Weigher, asynchronous refresh with refreshAfterWrite, and hit ratio monitoring with recordStats() and Micrometer — everything you need to know before going to production.
-
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, key design with @CacheConfig and KeyGenerator, switching to Caffeine and Redis with per-cache TTLs, 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.