Individual Cache Settings - Alfresco Content Services - 23.4 - 23.4 - Ready - Alfresco - external

Alfresco Content Services

Platform
Alfresco
Product
Alfresco Content Services
Release
23.4
License

Content Service uses cache properties for both clustered and non-clustered configurations.

To configure a cache, specify a series of properties where the property names begin with the cache name as specified in the Spring cache definition. For example, if the cache name is cache.myCache, then the properties should all start with cache.myCache.

For example:

cache.myCache.maxItems=20000
cache.myCache.timeToLiveSeconds=0

The following properties are supported by both clustered and non-clustered (for example, cluster.type=local) caches:

Property Description
maxItems The maxItems attribute is the maximum size a cache can reach. Use zero (0) to set to Integer.MAX_VALUE.
eviction-policy When the eviction-policy attribute is set to NONE, the cache won’t have a bounded capacity, and the maxItems attribute won’t apply. Any other value will cause the maxItems attribute to be enabled.Also, use LRU (Least Recently Used) or LFU (Least Frequently Used) algorithm with clustered caches so that the value is compatible in both modes (required during startup). Note that the actual value (for example, LRU) is of no consequence for the non-clustered caches and eviction is performed as for any Google Guava CacheBuilder created cache.
timeToLiveSeconds The timeToLiveSeconds attribute specifies that the cache items will expire once this time has passed after creation.
maxIdleSeconds The maxIdleSeconds attribute specifies that the cache items will expire when not accessed for this period.
tx.maxItems The overflowToDisk attribute isn’t a fully supported property as TransactionalCache is a separate entity, but where a TransactionalCache bean has been defined, use {cacheName}.tx.maxItems to specify its capacity.

The following properties are available for fully-distributed caches and aren’t supported by the other cache types:

Property Description
cluster.type The cluster.type attribute determines what type of cache is created when clustering is available. The acceptable values are:
  • fully-distributed: Uses a Hazelcast IMap backed distributed cache. The cache values can be stored on any member of the cluster, hence the term fully-distributed.
  • local: Always use a non-clustered cache. The cache values won't reflect updates made to the equivalent cache on another cluster member.
  • invalidating: Uses a local cache, but when an update or a removal is issued to the cache, an invalidation message is broadcast to all members of the cluster, and those members will remove the value from their cache. This value is useful where frequent reads cause performance problems (due to remote reads) or where values are non-serializable.
backup-count The backup-count attribute controls how many cluster members should hold a backup of the key/value pair.
merge-policy The merge-policy attribute determines how Hazelcast recovers from split brain syndrome, for example:
  • com.hazelcast.map.merge.PassThroughMergePolicy
  • com.hazelcast.map.merge.PutIfAbsentMapMergePolicy (the default)
  • com.hazelcast.map.merge.HigherHitsMapMergePolicy
  • com.hazelcast.map.merge.LatestUpdateMapMergePolicy
See Network Partitioning (Split-Brain Syndrome) for more information.