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.