- Home
- Caching Software
- Caffeine
Caffeine
What it is
Caffeine is a free, open-source in-memory caching library for Java applications. It can load cache entries automatically, with asynchronous loading available as an option. For cache management, it supports size-based eviction that accounts for frequency and recency, as well as expiration based on time since an entry was accessed or written. It can also refresh entries asynchronously when a request first encounters stale data. Other capabilities include weak keys, weak or soft values, removal notifications, writes to external resources, and cache statistics. The project provides JSR-107 JCache and Guava adapters, plus a simulation extension. Its README lists community integrations with Spring Cache, Play Framework, Micronaut, Quarkus, and Apache Camel. Developers can obtain the library through Maven Central, with Gradle coordinates for the core package and optional Guava and JCache extensions. The project recommends version 3.x for Java 11 or newer and version 2.x for other Java versions. Caffeine is licensed under Apache License, Version 2.0. Maven Central artifacts are accompanied by GPG and Sigstore validation files, and security issues can be reported privately through GitHub.
For and against
For
- Free under the Apache License, Version 2.0
- Supports asynchronous loading and refresh
- Offers size-based eviction and time-based expiration
- Provides JCache and Guava adapters
Against
- Version 3.x requires Java 11 or above
- It is an in-memory cache library, not edge caching
The verdict
Caffeine offers a broad set of cache controls and extensions for Java projects. Developers should select the version that matches their Java runtime and account for its in-memory application-data focus.
Who it suits
Caffeine suits Java developers who need an in-memory cache with configurable loading, eviction, expiration, and refresh behavior. Its adapters and listed community integrations may also suit projects already using those frameworks or cache interfaces.
Plans and prices
Caffeine
Open-source Java caching library · Java 11+ for 3.x; Java versions below 11 use 2.x
Read 9 Oct 2026 · github.com
On the record
- Artifact signatures
- The security policy states that Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files.github.com · read 9 Oct 2026
- Artifact validation
- The security policy says Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files.github.com · read 4 Oct 2026
- Automatic loading
- Cache entries can be loaded automatically, optionally asynchronously.github.com · read 9 Oct 2026
- Cache API
- It provides an in-memory cache using an API inspired by Google Guava.github.com · read 9 Oct 2026
- Distribution
- The project directs users to Maven Central and shows Gradle dependencies for the core library and optional Guava and JCache extensions.github.com · read 9 Oct 2026
- Download
- The project directs users to Maven Central and provides Gradle dependency coordinates for the library and optional Guava and JCache extensions.github.com · read 4 Oct 2026
- Eviction
- Size-based eviction uses frequency and recency when a configured maximum is exceeded.github.com · read 9 Oct 2026
- Eviction and expiration
- Caffeine supports size-based eviction using frequency and recency, plus time-based expiration measured since last access or write.github.com · read 4 Oct 2026
- Expiration and refresh
- Entries can expire based on time since last access or write, and stale entries can refresh asynchronously when first requested.github.com · read 9 Oct 2026
- Extensions
- Optional extensions include JSR-107 JCache, Guava adapters, and simulation.github.com · read 9 Oct 2026
- Integrations
- The project lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus, Camel, and Kotlin and Scala wrappers.github.com · read 9 Oct 2026
- Java version
- The README says to use version 3.x for Java 11 or above and 2.x otherwise.github.com · read 9 Oct 2026
- License
- The repository identifies Apache-2.0 as the project license.github.com · read 9 Oct 2026
- Loading
- Caches can load entries automatically, optionally asynchronously.github.com · read 4 Oct 2026
- Other cache features
- The library supports weak keys, weak or soft values, removal notifications, writes to external resources, and cache statistics.github.com · read 4 Oct 2026
- Product
- Caffeine is a high-performance, near-optimal in-memory caching library for Java.github.com · read 4 Oct 2026
- Purpose
- Caffeine is a high-performance, near-optimal in-memory caching library for Java.github.com · read 9 Oct 2026
- References and removal
- Keys can use weak references, values can use weak or soft references, and the cache can notify when entries are evicted or removed.github.com · read 9 Oct 2026