Created
July 29, 2024 12:30
-
-
Save mrniko/f66a44043fb95241ebdfdc1247061579 to your computer and use it in GitHub Desktop.
hibernate local cache example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<property name="hibernate.cache.region.factory_class" value="org.redisson.hibernate.RedissonLocalCachedRegionFactory" /> | |
<!-- 2nd level cache activation --> | |
<property name="hibernate.cache.use_second_level_cache" value="true" /> | |
<property name="hibernate.cache.use_query_cache" value="true" /> | |
<!-- Redisson can fallback on database if Redis cache is unavailable --> | |
<property name="hibernate.cache.redisson.fallback" value="true" /> | |
<!-- Redisson YAML config (located in filesystem or classpath) --> | |
<property name="hibernate.cache.redisson.config" value="/redisson.yaml" /> | |
<!-- cache definition applied to all caches in entity region --> | |
<property name="hibernate.cache.redisson.entity.eviction.max_entries" value="10000" /> | |
<property name="hibernate.cache.redisson.entity.expiration.time_to_live" value="600000" /> | |
<property name="hibernate.cache.redisson.entity.expiration.max_idle_time" value="300000" /> | |
<property name="hibernate.cache.redisson.entity.localcache.max_idle_time" value="300000" /> | |
<property name="hibernate.cache.redisson.entity.localcache.time_to_live" value="300000" /> | |
<property name="hibernate.cache.redisson.entity.localcache.eviction_policy" value="LRU" /> | |
<property name="hibernate.cache.redisson.entity.localcache.sync_strategy" value="INVALIDATE" /> | |
<property name="hibernate.cache.redisson.entity.localcache.reconnection_strategy" value="CLEAR" /> | |
<property name="hibernate.cache.redisson.entity.localcache.size" value="5000" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment