Caffeine is a Java 8 based concurrency library that provides specialized data structures, such as a high performance cache. Please see our documentation for more details.
compile 'com.github.ben-manes.caffeine:caffeine:1.0.1'
// Optional extensions
compile 'com.github.ben-manes.caffeine:guava:1.0.1'
compile 'com.github.ben-manes.caffeine:jcache:1.0.1'
compile 'com.github.ben-manes.caffeine:tracing-async:1.0.1'
Snapshots of the development version is available in Sonatype's snapshots repository.
- automatic loading of entries into the cache, optionally asynchronously
- least-recently-used eviction when a maximum size is exceeded
- time-based expiration of entries, measured since last access or last write
- keys automatically wrapped in weak references
- values automatically wrapped in weak or soft references
- notification of evicted (or otherwise removed) entries
- accumulation of cache access statistics
In addition, Caffeine (javadoc) offers the following extensions:
- tracing (api javadoc, async javadoc)
- simulation (javadoc)
- JSR-107 JCache (javadoc)
- Guava adapters (javadoc)