Caffeine

What Caffeine 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. Its eviction controls consider cache size, frequency and recency; entries can also expire based on the time since their last access or write. When the first request reaches a stale entry, Caffeine can refresh it asynchronously. Other supported features 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. Its README lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus and Apache Camel. The library is available through Maven Central, with Gradle coordinates for the core library and optional Guava and JCache extensions. The project recommends version 3.x for Java 11 or newer and version 2.x otherwise. Caffeine is distributed under the Apache License, Version 2.0.
Who it suits
Caffeine suits Java developers who need an in-memory cache and want options for loading, eviction and expiration. The project also provides adapters and integrations for several Java frameworks.
What it does well
- Free and open source under Apache License 2.0
- Supports asynchronous loading and refresh
- Offers size-, frequency- and recency-based eviction
- Includes JCache and Guava adapters
- Provides cache statistics and removal notifications
What to know first
- Version 3.x requires Java 11 or above
- The library is for in-memory caching, not edge caching
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Caffeine | Open-source Java caching library · Java 11+ for 3.x; Java versions below 11 use 2.x | Free |
As github.com lists them, read 9 Oct 2026. The maker's own page has the final word.
Getting started
- Open the project website on GitHub.
- Choose Caffeine 3.x for Java 11 or later, or 2.x for earlier Java versions.
- Get the library from Maven Central or use the provided Gradle coordinates.
- Add the optional Guava or JCache extension if needed.
Verdict
Caffeine provides Java applications with configurable in-memory caching, including asynchronous loading and refresh. Check the Java version guidance before choosing between the 3.x and 2.x releases.
Questions
How much does Caffeine cost?
Caffeine is free. The listed plan is free.
Is Caffeine open source?
Yes. It is distributed under the Apache License, Version 2.0.
Which Java versions does it support?
The project recommends version 3.x with Java 11 or later and version 2.x otherwise.
Where can developers get Caffeine?
The project directs developers to Maven Central and provides Gradle dependency coordinates for the library and optional Guava and JCache extensions.
Does Caffeine integrate with other tools?
It offers JSR-107 JCache and Guava adapters. The project README also lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus, and Apache Camel.
Facts from Caffeine's own pages
- Artifact signatures
- The security policy states that Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files. · github.com, 9 Oct 2026
- Artifact validation
- The security policy says Maven Central artifacts are accompanied by GPG .asc and Sigstore .sigstore.json files. · github.com, 4 Oct 2026
- Automatic loading
- Cache entries can be loaded automatically, optionally asynchronously. · github.com, 9 Oct 2026
- Cache API
- It provides an in-memory cache using an API inspired by Google Guava. · github.com, 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, 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, 4 Oct 2026
- Eviction
- Size-based eviction uses frequency and recency when a configured maximum is exceeded. · github.com, 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, 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, 9 Oct 2026
- Extensions
- Optional extensions include JSR-107 JCache, Guava adapters, and simulation. · github.com, 9 Oct 2026
- Integrations
- The project lists community integrations including Spring Cache, Play Framework, Micronaut, Quarkus, Camel, and Kotlin and Scala wrappers. · github.com, 9 Oct 2026
- Java version
- The README says to use version 3.x for Java 11 or above and 2.x otherwise. · github.com, 9 Oct 2026
- License
- The repository identifies Apache-2.0 as the project license. · github.com, 9 Oct 2026
- Loading
- Caches can load entries automatically, optionally asynchronously. · github.com, 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, 4 Oct 2026
- Product
- Caffeine is a high-performance, near-optimal in-memory caching library for Java. · github.com, 4 Oct 2026
- Purpose
- Caffeine is a high-performance, near-optimal in-memory caching library for Java. · github.com, 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, 9 Oct 2026
- Refresh
- Caffeine can asynchronously refresh an entry when the first stale request occurs. · github.com, 4 Oct 2026
- Security reporting
- The security policy asks users to report security issues privately through GitHub's vulnerability reporting mechanism. · github.com, 9 Oct 2026
- Statistics and writes
- Caffeine can accumulate access statistics and propagate writes to an external resource. · github.com, 9 Oct 2026
Where Caffeine stands on Freedom251
- Caching Software#9 of 27