Dashboard > Penrose 1.0 > ... > Cache > In-Memory Cache
In-Memory Cache
Added by Endi S. Dewata, last edited by Jim Yang on Jun 05, 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.

Enabling In-Memory Cache

In-memory cache is the default cache in Penrose.

<server>

  <entry-cache>
    <cache-class>org.safehaus.penrose.cache.InMemoryEntryCache</cache-class>
  </entry-cache>

  <source-cache>
    <cache-class>org.safehaus.penrose.cache.InMemorySourceCache</cache-class>
  </source-cache>

</server>

Configuring Cache

Each source and entry mapping has its own cache and it's configured separately. See Sources and Entry Mappings. Currently you can configure the cache size and expiration. The cache will be invalidated when it's expired or an update operation is performed against it.

You can disable cache entirely by setting the Source and Entry cache expiration to 0. In this case no data will be cached, all requests will be forwarded directly to the datasource.

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