Caffeine cache is a high-performance caching library written in Java.
I am going to use following dependency for this tutorial.
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.0.1</version>
</dependency>
- Hello world
- Load not found values automatically
- LoadingCache: Load the value from CacheLoader
- Asynchronous loading of data
- Get cache size
- Eviction strategies
- size based eviction
- Time based eviction
- Set custom eviction policy
- Reference based eviction
- Record statistics
- Listen when the cache entry expired
- Get age of element in the cache
- print elements of cache
- Invalidate (or) delete an entry from cache
- Delete all the entries from cache
No comments:
Post a Comment