Documentation
Liferay provides a rich store of resources and knowledge to help our community better use and work with our technology.
Ehcache
Set the classpath to the location of the Ehcache config file for internal caches. Edit the file specified in the property ehcache.multi-vm.config.location to enable clustered cache.
ehcache.single.vm.config.location=/ehcache/liferay-single-vm.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml
Uncomment the following in a clustered environment.
ehcache.multi.vm.config.location.peerProviderProperties=peerDiscovery=automatic,multicastGroupAddress=${multicast.group.address["multi-vm"]},multicastGroupPort=${multicast.group.port["multi-vm"]},timeToLive=1
Input a class name that extends net.sf.ehcache.bootstrap.BootstrapCacheLoaderFactory. This class is used by Ehcache to determine how caches communicate with each other in a clustered environment.
Examples:
ehcache.bootstrap.cache.loader.factory=net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory
ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory
Input a class name that extends net.sf.ehcache.event.CacheEventListenerFactory. This class is used by Ehcache to determine how caches communicate with each other in a clustered environment.
Examples:
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.RMICacheReplicatorFactory
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory
Input a class name that extends net.sf.ehcache.distribution.CacheManagerPeerProviderFactory. This class is used by Ehcache to determine how caches communicate with each other in a clustered environment.
Examples:
ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory
ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory
Set this to true to enable JMX integration in com.liferay.portal.cache.EhcachePortalCacheManager. Set this to false if the portal needs to be reloaded under WebSphere.
Example:
ehcache.portal.cache.manager.jmx.enabled=true
Set this to true to allow Ehcache to use blocking caches. This improves performance significantly by locking on keys instead of the entire cache. The drawback is that threads can hang if the cache is not used properly. Make sure that all queries that return a miss also immediately populate the cache, or else other threads that are blocked on a query of that same key will continue to hang. Reference Ehcache's BlockingCache for more information. The blocking cache is no longer implemented by Ehcache's BlockingCache, but by Liferay's BlockingPortalCache for better safety and faster performance.
ehcache.blocking.cache.allowed=true
Set this to true to enable Ehcache statistics.
ehcache.statistics.enabled=false