Documentation Center

Configuring caching of individual types of items

By default, if embedded caching is enabled on the server, all types of items are cached. In the Storage Layer configuration file, cd_storage_conf.xml, you can override this default and control the caching per item type.

About this task

Depending on your implementation, you may want to exclude certain types of items from caching. For example, if your database contains high-resolution images whose caching would cost huge amounts of memory, you might want to not cache images, or only images of certain file types. You can do this by configuring caching on an item type level.

If caching is enabled (or disabled) in cd_storage_conf.xml for a specific item type, caching must also be enabled (or disabled) for the corresponding cache region (or for all cache regions) in application.properties.

Procedure

  1. Open the cd_storage_conf.xml file of the Content Deployer for editing.
  2. Find the ItemTypes element.
  3. Add one or more Item elements within the ItemTypes element, specifying the overall item type in a typeMapping attribute, and, if necessary, the specific file extension in an itemExtension attribute. For example:
    <ItemTypes defaultStorageId="defaultdb" cached="${cacheenabled:-true}">
      <Item typeMapping="Binary" itemExtension=".iso" cached="false"/>
      <Item typeMapping="Page" cached="false"/>
    </ItemTypes>

    The code fragment above specifies that binary items with an .iso extension should not be cached, and that Pages should not be cached, either.

  4. Save and close cd_storage_conf.xml.
  5. Make the same changes in the cd_storage_conf.xml file of the Content Service.