Monday 27 June 2022

Ehcache tutorial

Ehcache is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It's the most widely-used Java-based cache because it's robust, proven, full-featured, and integrates with other popular libraries and frameworks. Ehcache scales from in-process caching, all the way to mixed in-process/out-of-process deployments with terabyte-sized caches.

 


 

Dependency used for this tutorial

<!-- https://mvnrepository.com/artifact/org.ehcache/ehcache -->
<dependency>
    <groupId>org.ehcache</groupId>
    <artifactId>ehcache</artifactId>
    <version>3.10.0</version>
</dependency>

 

 

      Ehcache: Hello World application
      Ehcache: Exploring CacheManager
            Ehcache: Create a cache
            Ehcache: Get the Cache instance by alias name
            Ehcache: Remove the cache by alias name
            Ehcache: Start all the CacheManager services
            Ehcache: Close all the caches and stop all the services managed by this CacheManager
            Ehcache: Get the current status of CacheManager
            Ehcache: Close all the caches and stop all the services managed by this CacheManager
            Ehcache: Get the current status of CacheManager
            Ehcache: Get the run time configuration of CacheManager
      Exploring Ehcache cache object
            Ehcache: Put an element into the cache
            Ehcache: Get the value associated with given key
            Ehcache: Check for the key existence in the cache
            Ehcache: Remove the entry from cache
            Ehcache: Get all the values associated with given keys
            Ehcache: bulk cache writing support using putAll method
            Ehcache: Remove multiple elements from the cache
            Ehcache: Remove all the elements from the cache
            Ehcache: putIfAbsent: Insert when the key is not exist in the cache
            Ehcache: remove the entry only when the cache has given value
            Ehcache: replace: Replace the entry when the entry is not expired
            Ehcache: Replace the entry when the key mapped to given value
            Ehcache: get run time configurations of cache
            Ehcache: Print all the cache elements using iterator
            Ehcache: Set the expiry time at cache level
            Ehcache: programmatically set expiry time to a cache entry
            Ehcache: Configure a cache using xml file
            Ehcache: Store the cache data to disk

 

Previous                                                 Next                                                 Home

No comments:

Post a Comment