Two kinds of caches are supported: memory caches and persistent caches.
Persistent caches store their content in a filessystem.
Cache templates are supported, which can be used to define default cache
configurations.
| Property | Required | Description |
| yes | The List of preconfigured cache names |
| Property | Required | Description |
| no | The List of cache templates (template names must be distinct from all cache names) |
Example:
cache.templates = simpletempl cache.caches = memcache,perscache
A cache template may contain all the properties that are for suitable for a cache. When a cache uses a template, all the properties of the template are added to the cache properties. Cache properties always override template properties.
Example:
template.simpletempl.type = memory template.simpletempl.class = com.sapportals.wcm.util.cache.memory.MemoryLRUCache template.simpletempl.capacity = 1000 template.simpletempl.maxsize = 0 template.simpletempl.maxentrysize = 0 template.simpletempl.defaulttimetolive = 300 template.simpletempl.averageentrysize = 0 template.simpletempl.singleton = true
| Property | Required | Description |
| yes | The type of the cache (memory or persistent) |
| yes | The Java class implementing the cache, com.sapportals.wcm.util.cache.memory.MemoryLRUCache |
| yes | The capacity of the cache (i.e. the max. number of cache entries) |
| yes | The max. value for the sum of the size of all cache entries in bytes (0 means no limit) |
| yes | The max. size of a cache entry in bytes (0 means no limit) |
| yes | The default time in seconds after which a cache entry is removed from the cache automatically (0 means no expiration) |
| yes | The size in bytes a new cache entry is assumed to have if no other size is specified |
| yes | The instantiation type of the cache (true for singleton, false otherwise) |
Example (using no template):
cache.memcache.type = memory cache.memcache.class = com.sapportals.wcm.util.cache.memory.MemoryLRUCache cache.memcache.capacity = 1000 cache.memcache.maxsize = 1000000 cache.memcache.maxentrysize = 1000 cache.memcache.defaulttimetolive = 300 cache.memcache.averageentrysize = 1000 cache.memcache.singleton = true
Example (using a template):
cache.memcache.template = simpletempl cache.memcache.capacity = 512
| Property | Required | Description |
| yes | The type of the cache (memory or persistent) |
| yes | The Java class implementing the cache, com.sapportals.wcm.util.cache.persistent.PersistentLRUCache |
| yes | The capacity of the cache (i.e. the max. number of cache entries) |
| yes | The max. value for the sum of the size of all cache entries in bytes (0 means no limit) |
| yes | The max. size of a cache entry in bytes (0 means no limit) |
| yes | The default time in seconds after which a cache entry is removed from the cache automatically (0 means no expiration) |
| yes | The Java class implementing the persistent cache map, com.sapportals.wcm.util.cache.persistent.filesystem.FilesystemMap |
| yes | The folder in which the cache files are stored (must exist already) |
| yes | The prefix which is preceded the names of the cache files |
| yes | The desired security type of the cache (true for encrypted cache, false otherwise) |
| yes | The desired initialization type of the cache (true if the cache is cleared during initialization, false otherwise) |
Example:
cache.perscache.type = persistent cache.perscache.class = com.sapportals.wcm.util.cache.persistent.PersistentLRUCache cache.perscache.capacity = 1000 cache.perscache.maxsize = 50000000 cache.perscache.maxentrysize = 10000 cache.perscache.defaulttimetolive = 600 cache.perscache.storageclass = com.sapportals.wcm.util.cache.persistent.filesystem.FilesystemMap cache.perscache.folder = /temp cache.perscache.fileprefix = perscache_ cache.perscache.secure = true cache.perscache.clearcacheoninit = true