Legacy Knowledge Base
Published Sep. 10, 2025

CacheFilter Expiration time

Written By

Ankit Gupta

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

The cache filter caches processed web content.  To change the cache expiration time to live ehcache.xml needs to be modified. So where can we set the expiration time.

Environment

  • Liferay DXP 7.0

Resolution

The ehcahce.xml referred in this property is the /liferay-single-vm.xml and / liferay-multi-vm-clustered.xml[Liferay_Home\osgi\marketplace\Liferay Foundation.lpkg\com.liferay.portal.cache.ehcache-2.1.20.jar\ehcache\]. You can set your custom cache expiration time in liferay-multi-vm-clustered.xml for which, following element needs to be used under <defaultCache> tag timeToLiveSeconds="time_in_sec"

The default value is "0" for timeToLiveSeconds. 

Additional Information

For more information regarding the same, please this article ehcache link (Setting Expiration section).

However, the above approach should only be followed when you are not able to create a custom cache configuration based on the DefaultCache and can't modify the Defaultcache itself.

Did this article resolve your issue ?

Legacy Knowledge Base