Introduction
As the name implies, in-memory cache stores the cache data in the memory. This cache is fast because it doesn't require initialization and only store partial copy of the datasource. However, if the server is restarted, the cache data is lost. This configuration is recommended for databases that are small or rarely change.
Configuration
The global configuration should be specified in PENROSE_SERVER_HOME/conf/server.xml in the DEFAULT handler.
<handler name="DEFAULT"> <handler-class>org.safehaus.penrose.handler.DefaultHandler</handler-class> <parameter> <param-name>cache</param-name> <param-value>true</param-value> </parameter> <parameter> <param-name>cacheSize</param-name> <param-value>...</param-value> </parameter> <parameter> <param-name>cacheExpiration</param-name> <param-value>...</param-value> </parameter> </handler>
The global configuration can be overriden in each entry mapping in mapping.xml in case you want to disable cache or change the cache parameters for a particular entry mapping.
<entry dn="..."> ... <parameter> <param-name>cache</param-name> <param-value>false</param-value> </parameter> <parameter> <param-name>cacheSize</param-name> <param-value>...</param-value> </parameter> <parameter> <param-name>cacheExpiration</param-name> <param-value>...</param-value> </parameter> </entry>
Parameters
| Parameter | Description | Valid Values | Default Value |
|---|---|---|---|
| cache | Enable/disable cache | true/false | false |
| cacheSize | Max. entries stored in cache | integer >= 0 | 10 |
| cacheExpiration | Cache expiration (in minutes) | integer >= 0 | 10 |
