In-Memory Cache
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.