Documentation Center

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

  1. In your Java/JSP web application, open the file WEB-INF/classes/cd_client_conf.xml for editing.
  2. To enable client-side caching, ensure that the CacheEnabled attribute of the ServiceConfig element is present and set to true.
  3. To set the expiration of the client-side cache, ensure that the CacheExpirationDuration attribute of the ServiceConfig element is present and set to the desired interval in seconds.
  4. 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 CacheUri attribute.
  5. Alternatively, if you intend to use a Redis database for cache storage, comment out the active ServiceConfig element and uncomment the ServiceConfig element for Redis.
  6. In the commented-out ServiceConfig element, set values for the following attributes:
    AttributeDescription
    CacheUriThe Redis storage host name for connection.
    CacheClientIdThe client ID needed to access the Redis database.
    CachePasswordThe password needed to access the Redis database.
  7. Save and close cd_client_conf.xml to apply your changes.