Configuring Java/JSP client-side caching
Edit the Content Delivery Client configuration file, cd_client_conf.xml, to configure caching for your Java/JSP website.
Procedure
- In your Java/JSP web application, open the file WEB-INF/classes/cd_client_conf.xml for editing.
- To enable client-side caching, ensure that the
CacheEnabledattribute of theServiceConfigelement is present and set totrue. - To set the expiration of the client-side cache, ensure that the
CacheExpirationDurationattribute of theServiceConfigelement is present and set to the desired interval in seconds. - By default, if you use the default storage solution rather than the alternative, a Redis database, Content Delivery looks for a file called ehcache.xml or, if that file is absent, for failsafe-ehcache.xml, for its detailed caching configuration. If you want the CIL to make use of a specific Ehcache configuration file instead, you can specify the URI of that file in a
CacheUriattribute. - Alternatively, if you intend to use a Redis database for cache storage, comment out the active
ServiceConfigelement and uncomment theServiceConfigelement for Redis. - In the commented-out
ServiceConfigelement, set values for the following attributes:Attribute Description CacheUriThe Redis storage host name for connection. CacheClientIdThe client ID needed to access the Redis database. CachePasswordThe password needed to access the Redis database. - Save and close cd_client_conf.xml to apply your changes.