json-logic-java icon indicating copy to clipboard operation
json-logic-java copied to clipboard

Added ability to use Caffeine for Caching, which enables additional features like eviction, which is not supported by existing ConcurrentHashMap parseCache (#45)

Open siddarthaboddu opened this issue 7 months ago • 1 comments

Issue: https://github.com/jamsesso/json-logic-java/issues/45 This change is to provide clients option to use Caffeine with a pre configured max size, so that the parseCache does not grow indefinitely which were causing JVM high memory issues

Changes:

  • Added CacheManager interface to be able to use ConcurrentHashMap or Caffeine for caching.
  • Added ConcurrentHashMapCacheManager class which uses ConcurrentHashMap for caching, this will be default behaviour ensuring backward compatibility.
  • Added CaffeineCacheManager which uses Caffeine for caching, and provides option to specify a max size of the cache.
  • Minor update to the version from 1.1.1-SNAPSHOT to 1.1.2-SNAPSHOT

siddarthaboddu avatar May 17 '25 21:05 siddarthaboddu