# Caffeine

> A high performance, near optimal caching library for Java

Source: https://talira.ai/catalog/caffeine-r5tymmfx
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / caching](https://talira.ai/categories/libraries/caching)
- Platforms: linux, macos, windows[^2]
- Licence: Apache-2.0[^1]
- Pricing: Free[^1]
- Pricing notes: Open source under Apache 2.0.
- Free tier: yes[^1]
- Self-hostable: yes[^2]
- Backed by: [Ben Manes](https://talira.ai/orgs/ben-manes.md)

Caffeine is an in-memory caching library for Java with an API inspired by Google Guava's cache, built by the designer of Guava's cache and ConcurrentLinkedHashMap. A cache is configured with a builder: automatic (optionally asynchronous) loading of entries, size-based eviction that uses both frequency and recency for a near-optimal hit rate, expiry after access or write, asynchronous refresh of stale entries, weak and soft references, removal notifications, write-through to an external resource and hit-rate statistics. Extensions add a JSR-107 JCache provider, Guava adapters and a simulator for comparing eviction policies.

## Links

- GitHub: https://github.com/https://github.com/ben-manes/caffeine
- Docs: https://github.com/ben-manes/caffeine/wiki

## Problems it solves

- cache expensive lookups in memory in a Java service
- evict cache entries by size or time without writing my own LRU
- a faster replacement for Guava's cache
- refresh cached values in the background before they go stale
- load cache entries asynchronously with CompletableFuture
- a JCache (JSR-107) provider for my Java application
- measure cache hit rates in a JVM app

## Features

- automatic and asynchronous loading
- size-based eviction by frequency and recency
- expiry after access or write
- asynchronous refresh
- weak keys and weak or soft values
- removal listeners
- write propagation to external resources
- statistics
- JSR-107 JCache extension
- Guava adapters
- eviction policy simulator

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.27 out of 1.
Signals: backing 0.30, extensibility 0.00.

- backed by Ben Manes

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [Guava](https://talira.ai/catalog/guava-xdacvwhb.md): Google core libraries for Java

## Sources

[^1]: https://github.com/ben-manes/caffeine/blob/master/LICENSE (checked 23 Nov 2026)
[^2]: https://github.com/ben-manes/caffeine (checked 23 Nov 2026)
