This version is a development preview and not recommended for production use. Please give feedback to help stabilize and improve the next version.

New and Noteworthy

  • rename cache2k-impl to cache2k-core. That should be more intuitive for containing the actual “core” cache implementation in case there are more cache2k-xy jars in the classpath.
  • XSD schema for the XML configuration

Possible breakages

  • Renaming of method on MutableCacheEntry: setExpiry to setExpiryTime
  • JMX support is not enabled by default any more. It can be enabled per cache or globally, see the Statistics - cache2k Use Guide
  • improve generic type parameters in methods related to cache type configuration, affected methods: Cache2kConfiguration.setKeyType, Cache2kConfiguration.setValueType, CacheType
  • CacheEntry.getLastModifiedTime is not supported any more. Permanently throws exception, see: CacheEntry.getLastModifications - cache2k API documentation
  • Cache2kBuilder.disableLastModificationTime: deprecated, has no effect any more. Logic is reversed. The feature needs to be switched on when needed via recordRefreshTime.
  • ConfigurationSectionContainer: Implements collection interface, method add returns booleans.

Fixes and Improvements

  • JCache speedup: Do not support online listener attachment by default if in cache2k configuration mode. See JCache Optimizations and Semantics - cache2k Use Guide
  • Cache.removeIfEquals statistics: count miss and hit consistently
  • Exception propagation of CacheEntry.getValue covered by exception propagator again
  • JCache configuration: switch to cache2k semantics whenever a cache2k configuration file is present (before either a default or cache section needed to be present)
  • JCache, toString(): print useful toString() output for a JCache cache, delegates to the underlying cache2k cache
  • Cache2kBuilder.recordRefreshTime: Record time of last update or modification of an entry and make it available via `MutableCacheEntry.getRefreshTime
  • consolidate the output of the cache coordinates in the toString outputs
  • Cache2kConfiguration: add setters for collections (listeners and sections) to better integrate with other generic configuration code like Springs’ bean XML configuration.

Using this cache2k version

The binaries are available on maven central.

For Java SE/EE and Android environments

For Maven users:


Recommended for Gradle users:

def cache2kVersion = '1.1.3.Alpha'

dependencies {
    implementation "org.cache2k:cache2k-api:${cache2kVersion}"
    runtimeOnly "org.cache2k:cache2k-core:${cache2kVersion}"

Note to Android users: The included jar files contain code that might only be needed in server environments (e.g. JMX support). It is possible to strip unnecessary code. Example ProGuard rules can be found at Andriod - cache2k User Guide

Using the JCache / JSR107 provider

Maven users include the cache2k JCache provider this way:


For Gradle users:

dependencies {
    runtimeOnly "org.cache2k:cache2k-jcache:1.1.3.Alpha"

Implementation details, tuning tips and hints on configuration can be found at: JCache - cache2k User Guide

Back to top

Version: 1.2.3.Final. Last Published: 2019-08-08.