We are using SDL Web 8.5 and DXA 2.0 Java for our website. We would like to incorporate client-side (Content Interaction Library(CIL)) caching to improve site performance. Is there any example or documentation available to do it?
1 Answer
Refer to the SDL Documentation Content Delivery client configuration of ServiceConfig for Redis CIL cache.
Example:
<!--
A configuration sample for using Distributed Caching with Redis.
Please update the following fields:
CacheUri - in case of Redis is set to Redis hostname with a port number;
CacheClientId - should be the same for a bunch of CIL's which meant to be one environment;
CachePassword - Redis cache password. Delete this field if Redis is used without a password;
-->
<ServiceConfig CacheEnabled="true" CacheUri="localhost:6379"
ConnectionTimeout="10000" CacheExpirationDuration="600" ServiceAvailabilityCheck="true"
CacheProviderClass="com.sdl.web.client.cache.distributed.RedisCacheProvider"
CacheConnectionTimeout="10000"
CacheClientId="defaultCacheClientId"
CachePassword="encrypted:HzfQh9wYwAKShDxCm4DnnBnysAz9PtbDMFXMbPszSVY="
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schemas/cd_client_conf.xsd">
<DiscoveryService ServiceUri="http://localhost:8082/discovery.svc"/>
<TokenService ClientId="cduser" ClientSecret="encrypted:o/cgCBwmULeOyUZghFaKJA=="/>
</ServiceConfig>
Configuring web application caching (Java)
Updated:
I hope it helps.
-
Velmurugan thanks for your reply. Can u please also tell us is there any advantage using Redis cache instead of echache (default caching) Commented Apr 9, 2019 at 7:11
-
Updated the answer to provided the reference link for Ehcache vs Redis comparison– Velmurugan ♦Commented Apr 9, 2019 at 10:11