Skip to content

Releases: ben-manes/caffeine

2.9.1

03 May 02:33

Choose a tag to compare

Cache

  • Added cancellation of the next scheduled expiration cleanup when the cache becomes empty (#542)
  • Improved how variable expiration reorganizes the timer events (#541)
  • Added putIfAbsent optimistic fastpath (#506)

3.0.1

18 Mar 03:28

Choose a tag to compare

  • Fixed thread local fallback initialization for striped buffer (#515)
  • Improved eviction reordering for weighted caches (#513)
  • Added putIfAbsent optimistic fastpath (#506)

3.0.0

21 Feb 21:39

Choose a tag to compare

This release includes API incompatible changes.

Highlights

  • Java 11 or above is required
  • Java 8 users can continue to use version 2.x, which will be supported

API improvements

  • Added Policy.refreshes() for a snapshot of the in-flight refresh operations
  • CacheLoader and AsyncCacheLoader offer bulk factory methods
  • AsyncCacheLoader methods may now throw checked exceptions
  • Better usage of Checker Framework nullness annotations (#337)
  • LoadingCache.refresh now returns the in-flight future (#143)
  • Various unimplemented default methods are now abstract
  • Added LoadingCache.refreshAll convenience method
  • Bulk loads now receive a Set of keys (was Iterable)
  • More flexible generic bounds and type parameters

Implementation improvements

Incompatible changes

  • VarExpiration time-based puts now return the old value instead of a boolean result
  • Removed jandex resource as no longer utilized by Quarkus
  • Split Policy.Expiration into fixed and refresh interfaces

Deprecation removals

  • CacheWriter, SingleConsumerQueue, and UnsafeAccess
  • StatsCounter.recordEviction variations
  • CacheStats constructors

Notes

  • CacheWriter usages can be replaced by Map computations and Caffeine.evictionListener
  • For best performance Unsafe may be used if available, otherwise falls back to VarHandles
  • We will continue to support and maintain version 2.x for Java 8 users

2.9.0

16 Feb 05:15

Choose a tag to compare

Cache

  • Added Caffeine.evictionListener which is notified within the atomic operation when an entry is automatically removed
  • Added triggering cache maintenance if an iterator observes an expired entry for more aggressive eviction (#487)
  • Improved eager eviction of an added or updated entry if it exceeds the cache's maximum weight
  • Deprecated CacheWriter. Please use asMap computations or an eviction listener instead
  • Added CacheStats.of(...) to allow for becoming a value-based class in a future release

2.8.8

08 Dec 06:21

Choose a tag to compare

Cache

2.8.7

07 Dec 06:56

Choose a tag to compare

Cache

  • Fixed asMap().keySet().toArray() to not return expired mappings (#472)
  • Added support for ISO-8601 durations to CaffeineSpec (#466)
  • Fixed put update optimization for variable expiration (#478)

2.8.6

12 Oct 05:50

Choose a tag to compare

Cache

  • Changed false sharing protection to comply with JDK 15's field layout (Java Objects Inside Out)
  • Suppressed the removal listener notification when an AsyncCache future value resolves to null
  • Improved the implementations of AsyncCache.synchronous().asMap() conditional methods
  • Added Jandex index for assisting GraalVM AOT (quarkusio/quarkus#10420)
  • Deprecated UnsafeAccess and SingleConsumerQueue

JCache

  • Changed to an OSGi Component to avoid coupling consumers to the provider (#447)
  • Added the ability to record native statistics (#460)

2.8.5

29 Jun 04:11

Choose a tag to compare

Cache

  • Fixed expiration delay for scheduled cleanup (#431)

2.8.4

21 May 04:47

Choose a tag to compare

Cache

  • Schedule maintenance on an absent getIfPresent if there is pending work (#420)

2.8.3

18 May 07:11

Choose a tag to compare

Cache

  • Added Policy.getIfPresentQuietly to lookup without affecting the metadata (#418)