Skip to content
OCEE documentation
OCEE documentation

Setup/Configuration

This page describes how to install the OCEE Accelerator, and which configuration options are available.

First make sure that OCEE itself is installed.

Then, make the following configuration changes in the configuration folder ${OPENCMS_HOME}/WEB-INF/config/:

Add the cache configuration class under the /opencms/configuration/ node, as follows:

<configuration>
...
    <config class="org.opencms.ocee.cache.CmsCacheConfiguration"/>
</configuration>

Add the new driver sequence in the opencms.properties configuration file, adding it under the  “Configuration of the driver manager” section, as follows:

#
# Configuration of the driver manager
###########################################################################
driver.vfs=\
cache,\
db
driver.project=\
cache,\
db
driver.user=\
cache,\
db
driver.history=db
driver.subscription=db

Add the driver classes in the opencms.properties configuration file, adding it under the “Configuration of the caches” section (it could be that this section does not exist in your current configuration file), as follows:

#
# Configuration of the cache drivers
###########################################################################
cache.vfs.driver=org.opencms.ocee.cache.CmsVfsCache
cache.project.driver=org.opencms.ocee.cache.CmsProjectCache
cache.user.driver=org.opencms.ocee.cache.CmsUserCache

The Accelerator configuration is maintained in the ${OPENCMS_HOME}/WEB-INF/config/ocee-cache.xml XML file. The following sections describe the configuration options for this file. For a standard configuration file, see the provided example configuration file.

  • Element: /opencms/cache
    Description: The main node of the configuration.
  • Element: /opencms/cache/online-flush-resource-limit
    Description: Number of resources that will trigger clearing the online cache if published
    at once.
    Default Value: 100
  • Element: /opencms/cache/drivers/vfs
    Description: The Virtual File System (VFS) cache driver.
    • Attribute: class
      Description: The drivers class name.
      Default Value: org.opencms.ocee.cache.CmsVfsCache
  • Element: /opencms/cache/drivers/vfs/capacities
    Description: A list of all configured caches capacities for this driver.
    See next section.
  • Element: /opencms/cache/drivers/project
    Description: The project cache driver.
    • Attribute: class
      Description: The drivers class name.
      Default Value: org.opencms.ocee.cache.CmsProjectCache
  • Element: /opencms/cache/drivers/user
    Description: The user cache driver.
    • Attribute: class
      Description: The drivers class name.
      Default Value: org.opencms.ocee.cache.CmsUserCache

This implementation provides caches for all DB drivers, except the history driver, ie. vfs, user and project drivers. Each of these cache drivers implement several caches that can be configured separately as described below. Note that cache capacities can also be set interactively through the user interface.

Every cache type (as enumerated in the org.opencms.ocee.cache.vfs.CmsVfsCacheInstanceType class) has to be configured in the configuration file in a separated /opencms/cache/drivers/vfs/capacities/capacity node, with the following structure:

  • Element: /opencms/cache/drivers/vfs/capacities/capacity/class
    Description: A class name for the cache instance.
    Default Value: One of the following:
    • org.opencms.ocee.cache.vfs.CmsCacheResources
    • org.opencms.ocee.cache.vfs.CmsCacheResourcesLists
    • org.opencms.ocee.cache.vfs.CmsCacheFiles
    • org.opencms.ocee.cache.vfs.CmsCacheProperties
    • org.opencms.ocee.cache.vfs.CmsCachePropertyDefinitions
    • org.opencms.ocee.cache.vfs.CmsCacheACE
    • org.opencms.ocee.cache.vfs.CmsCacheACEList
    • org.opencms.ocee.cache.vfs.CmsCacheParentFolder
    • org.opencms.ocee.cache.vfs.CmsCacheRelations
    • org.opencms.ocee.cache.vfs.CmsCacheResourceTree
    • org.opencms.ocee.cache.vfs.CmsCacheNonExistentResources
    • org.opencms.ocee.cache.vfs.CmsCacheUrlNames
  • Element: /opencms/cache/drivers/vfs/capacities/capacity/offline
    Description: The size, in number of cached items, of the offline cache for the given type.
    Default Value: Depending on the cache type, the default values are:
    • Resources: 4096
    • Resource Lists: 256
    • Files: 1024
    • Properties: 2048
    • Property Definitions: 128
    • Access Control Entries: 8192
    • Access Control Entry Lists: 8192
    • Parent Folders: 2048
    • Relations: 1024
    • Resource Trees: 128
    • Non-Existent Resources: 8192
    • URL names: 8192
  •  Element: /opencms/cache/drivers/vfs/capacities/capacity/online
    Description: The size, in number of cached items, of the offline cache for the given type.
    Default Value: The same as for the offline cache.
  • Element: /opencms/cache/drivers/vfs/capacities/capacity/params
    Description: An optional parameter for the given type.
    Default Value: The files cache is the only one that needs such a parameter, given the
    maximum size a cached file should have. The default value for it is:
    • maxlength:10240
      That is 10Kb. so, a maximum of 10Mb (10Kb * 1024) will be used to cache file contents.
      Starting with version 2.1.0 a new optional parameter has been included for the number
      of characters from the cached files to be shown in the Admin View. The default value for
      it is:
    • showlength:1024

Every cache type (as enumerated in the org.opencms.ocee.cache.user.CmsUserCacheInstanceType class) has to be configured in the configuration file in a separated /opencms/cache/drivers/user/capacities/capacity node, with the following structure:

  • Element: /opencms/cache/drivers/user/capacities/capacity/class
    Description: A class name for the cache instance.
    Default Value: One of the following:
    • o org.opencms.ocee.cache.user.CmsCacheUser
    • o org.opencms.ocee.cache.user.CmsCacheUserList
    • o org.opencms.ocee.cache.user.CmsCacheGroup
    • o org.opencms.ocee.cache.user.CmsCacheGroupList
  • Element: /opencms/cache/drivers/user/capacities/capacity/online
    Description: The size, in number of cached items, of the cache for the given type.
    Default Value: Depending on the cache type, the default values are:
    • Users: 8192
    • User Lists: 4096
    • Groups: 128
    • Group Lists: 4096
  • Element: /opencms/cache/drivers/user/capacities/capacity/params
    Description: An optional parameter for the given type.
    Default Value: Not used for user caches

Every cache type (as enumerated in the org.opencms.ocee.cache.project.CmsProjectCacheInstanceType class) has to be configured in the configuration file in a separated

/opencms/cache/drivers/project/capacities/capacity node, with the following structure:

  • Element: /opencms/cache/drivers/project/capacities/capacity/class
    Description: A class name for the cache instance.
    Default Value: One of the following:
    • org.opencms.ocee.cache.project.CmsCacheProjectResources
    • org.opencms.ocee.cache.project.CmsCachePublishedResources
    • org.opencms.ocee.cache.project.CmsCacheStaticExportResourceName
  • Element: /opencms/cache/drivers/project/capacities/capacity/online
    Description: The size, in number of cached items, of the cache for the given type.
    Default Value: Depending on the cache type, the default values are:
    • Project Resources: 64
    • Published Resources: 128
    • Static Export Resource Names: 2048
  • Element: /opencms/cache/drivers/project/capacities/capacity/params
    Description: An optional parameter for the given type.
    Default Value: Not used for project caches

Configuration example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE opencms SYSTEM "http://www.alkacon.com/dtd/6.0/ocee-cache.dtd">

<opencms>
	<cache>
		<online-flush-resource-limit>100</online-flush-resource-limit>
		<drivers>
			<vfs class="org.opencms.ocee.cache.CmsVfsCache">
				<capacities>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheResources</class>
						<offline>4096</offline>
						<online>8192</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheProperties</class>
						<offline>2048</offline>
						<online>2048</online>
					</capacity>

					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheACEList</class>
						<offline>4096</offline>
						<online>8192</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheParentFolder</class>
						<offline>2048</offline>
						<online>2048</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheFiles</class>
						<offline>512</offline>
						<online>512</online>
						<params>maxlength:10240,showlength:1024</params>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheRelations</class>
						<offline>4096</offline>
						<online>8192</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheNonExistentResources</class>
						<offline>4096</offline>
						<online>8192</online>
					</capacity>

					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCachePropertyDefinitions</class>
						<offline>128</offline>
						<online>128</online>
					</capacity>

					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheResourceLists</class>
						<offline>256</offline>
						<online>256</online>
					</capacity>

					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheResourceTree</class>
						<offline>0</offline>
						<online>128</online>
					</capacity>

					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheACE</class>
						<offline>64</offline>
						<online>64</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.vfs.CmsCacheUrlNames</class>
						<offline>4096</offline>
						<online>8192</online>
					</capacity>
				</capacities>
			</vfs>
			<project class="org.opencms.ocee.cache.CmsProjectCache">
				<capacities>
					<capacity>
						<class>org.opencms.ocee.cache.project.CmsCacheProjectResources</class>
						<online>64</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.project.CmsCachePublishedResources</class>
						<online>128</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.project.CmsCacheStaticExportResourceName</class>
						<online>1024</online>
					</capacity>
				</capacities>
			</project>
			<user class="org.opencms.ocee.cache.CmsUserCache">
				<capacities>
					<capacity>
						<class>org.opencms.ocee.cache.user.CmsCacheUser</class>
						<online>8192</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.user.CmsCacheUserList</class>
						<online>4096</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.user.CmsCacheGroup</class>
						<online>128</online>
					</capacity>
					<capacity>
						<class>org.opencms.ocee.cache.user.CmsCacheGroupList</class>
						<online>4096</online>
					</capacity>
				</capacities>
			</user>
		</drivers>
	</cache>
</opencms>