Dashboard > Penrose 1.2 > ... > Cache > In-Memory Cache
In-Memory Cache
Added by Jim Yang, last edited by Endi S. Dewata on Jun 18, 2007  (view change)
Labels: 
(None)


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

Site running on a free Atlassian Confluence Open Source Project License granted to Safehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators