cache2k v1.6.0.Final Release Notes

Release Date: 2020-10-08 // over 3 years ago
  • ๐ŸŽ cache2k is a high performance and light weight in-process caching library. Compared to other libraries
    (EHCache, Guava and Caffeine) it achieves the highest throughput for cache hits while still providing
    one of the best eviction efficiency. Advanced features of cache2k, like refresh ahead and resilience
    can solve typical application problems with ease.

    ๐ŸŒฒ This change log lists the complete changes since the last stable version 1.4.1.Final.

    ๐Ÿ†• New and Noteworthy

    • ๐Ÿ†• New timer based on hierarchical timer wheels, which is more performance and
      scales linear with more cache entries
    • No more extra thread per cache, in cache timer is used, e.g. for expiry

    Potential breakages

    • 0๏ธโƒฃ No separate executor for async listeners by default any more.
      If an async listener executor is not specified it uses the executor
      0๏ธโƒฃ defined by Cache2kBuilder.executor which in turn defaults to the
      common ForkJoinPool in Java 8.
    • Slightly more lag for operations triggered by time, e.g. cache
      cleanup after expiry, calls of expiry listeners, refreshing.
      The lag can be controlled by Cache2kBuilder.timerLag

    API Changes

    • ๐Ÿ—„ Deprecated ExpiryTimeValues.NO_CACHE
    • ๐Ÿ—„ Deprecated Cache2kBuilder.prefetchExecutor, introduced Cache2kBuilder.refreshExecutor (rename)
    • ๐Ÿ—„ Deprecated Cache.prefetch and Cache.prefetchAll

    ๐Ÿ›  Fixes and Improvements

    • โœ‚ Remove hash quality metric
    • MutableCacheEntry.reload() does load the entry even if already cached
    • ๐Ÿ‘€ After recovering from a load exception the expiry policy did not see the
      ๐Ÿ‘ป correct previous entry value with the exception
    • ๐Ÿ‘Œ Improved internal structure and test coverage

    Using this cache2k version

    The binaries are available on maven central.

    For Java SE/EE and Android environments

    For Maven users:

        <dependency>
          <groupId>org.cache2k</groupId>
          <artifactId>cache2k-base-pom</artifactId>
          <version>1.6.0.Final</version>
          <type>pom</type>
        </dependency>
    

    Recommended for Gradle users:

    def cache2kVersion = '1.6.0.Final'
    
    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:

        <dependency>
          <groupId>org.cache2k</groupId>
          <artifactId>cache2k-jcache</artifactId>
          <version>1.6.0.Final</version>
          <scope>runtime</scope>
        </dependency>
    

    For Gradle users:

    dependencies {
        runtimeOnly "org.cache2k:cache2k-jcache:1.6.0.Final"
    }
    

    ๐Ÿ”ง Implementation details, tuning tips and hints on configuration can be found at: [JCache - cache2k User Guide](https://cache2k.org/docs/latest/user-guide.html#jcache