Caffeine
github.com
- Free plan
- Self-hosted
What Caffeine is
Caffeine is a free, open-source in-memory caching library for Java applications. Its API is inspired by Google Guava, and it can load cache entries automatically, optionally asynchronously. When a configured maximum is reached, size-based eviction uses frequency and recency; entries can also expire based on time since their last access or write. If a request reaches a stale entry, Caffeine can refresh it asynchronously. Other capabilities include weak keys, weak or soft values, removal notifications, writes to external resources, and cache statistics. The project offers JSR-107 JCache and Guava adapters, along with a simulation extension. Listed community integrations include Spring Cache, Play Framework, Micronaut, Quarkus, and Apache Camel. Developers can get the library through Maven Central, with Gradle coordinates for the core library and optional Guava and JCache extensions. The project recommends version 3.x with Java 11 or later, and version 2.x for earlier Java versions. Caffeine is distributed under the Apache License, Version 2.0.
Who it suits
Caffeine suits Java developers who need in-memory application caching with configurable loading, eviction, expiration, and refresh. The project’s version guidance makes the Java runtime a key consideration.
Good to know, and what to watch
- Free and Apache License 2.0
- Automatic loading can be asynchronous
- Eviction considers frequency and recency
- Supports asynchronous refresh of stale entries
- Offers JCache and Guava adapters
- Version 3.x requires Java 11 or above
- Earlier Java versions use version 2.x
Plans
Every plan and priceCaffeine
Open source
The verdict
Caffeine provides in-memory caching features for Java projects, including loading, eviction, expiration, and optional integrations. Choose the project version according to the Java version in use.
What the maker publishes
- Artifact signatures
- The security policy states that Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files. source
- Artifact validation
- The security policy says Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files. source
- Automatic loading
- Cache entries can be loaded automatically, optionally asynchronously. source
- Cache API
- It provides an in-memory cache using an API inspired by Google Guava. source
- Distribution
- The project directs users to Maven Central and shows Gradle dependencies for the core library and optional Guava and JCache extensions. source
- Download
- The project directs users to Maven Central and provides Gradle dependency coordinates for the library and optional Guava and JCache extensions. source
- Eviction
- Size-based eviction uses frequency and recency when a configured maximum is exceeded. source
- Eviction and expiration
- Caffeine supports size-based eviction using frequency and recency, plus time-based expiration measured since last access or write. source
- Expiration and refresh
- Entries can expire based on time since last access or write, and stale entries can refresh asynchronously when first requested. source
- Extensions
- The project offers JSR-107 JCache, Guava adapters, and a simulation extension. source
- Extensions
- Optional extensions include JSR-107 JCache, Guava adapters, and simulation. source
- Integrations
- The README lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus, and Apache Camel. source
- Integrations
- The project lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus, Camel, and Kotlin and Scala wrappers. source
- Java version
- The project says to use version 3.x with Java 11 or above and version 2.x otherwise. source
- Java version
- The README says to use version 3.x for Java 11 or above and 2.x otherwise. source
- License
- The repository provides the software under the Apache License, Version 2.0. source
- License
- The repository identifies Apache-2.0 as the project license. source
- Loading
- Caches can load entries automatically, optionally asynchronously. source
- Other cache features
- The library supports weak keys, weak or soft values, removal notifications, writes to external resources, and cache statistics. source
- Product
- Caffeine is a high-performance, near-optimal in-memory caching library for Java. source
- Purpose
- Caffeine is a high-performance, near-optimal in-memory caching library for Java. source
- 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. source
- Refresh
- Caffeine can asynchronously refresh an entry when the first stale request occurs. source
- Security reporting
- Security issues can be reported privately through GitHub's vulnerability reporting mechanism. source
Checked against the maker's pages on 9 Oct 2026.