Performance · AMP

Redis and Ehcache Caching Configurations in Liferay

Ankita Varani · Published Apr 8, 2026 · 10 min read · View full version

Quick answer

Optimize performance by pairing local Ehcache (for quick widget objects caching) with a distributed Redis cluster (for session sharing and global caching), configuring Liferay's cache clustering settings in System Settings.

Tuning Ehcache XML Parameters

Liferay uses Ehcache for local caching. Tune liferay-multi-vm-clustered.xml. Adjust max elements in memory and set time-to-idle values to cache database results locally, reducing SQL query latency.

How Do You Connect Liferay DXP to a Redis Cache Cluster?

Direct Answer: Configure Redis properties in portal settings, specifying cluster endpoint URLs, security passwords, and connection timeout rules.

Configure Liferay's Redis integration in System Settings. Specify host addresses, ports, and connection pools. Redis shares cache items across portal instances, ensuring users retain session details when migrating across servers.

# Redis clustered environment configuration
redis.hosts=10.0.5.10:6379,10.0.5.11:6379
redis.timeout=2000
redis.maxTotal=100
For additional optimization strategies, visit our detailed Liferay DXP developer blog listing. For configuration specifications, consult the official Liferay Documentation portal.

Redis acts as a shared cache layer. When a portal node updates a record, it invalidates caches across nodes, keeping data uniform.

Frequently asked questions

Is Redis required for portal clustering?

Yes. Distributed portals must share session states and cache structures. Redis acts as the centralized cache provider for cluster nodes.

How do we flush Ehcache manually?

Go to Control Panel > Server Administration > Actions, and click 'Clear database cache' or 'Clear content cached across the cluster'.

Read the full article, with table of contents, comparison table, and author bio →