Configuring the Local CacheThis document is intended to provide various answers to questions regarding the configuration of a local cache. The document is presented in a question / answer format. Where is the configuration information?
Configuration of local caches involves editing the cache
configuration file, named
What is in the cache.ccf file?
The
There are three main sections of the
How do I set up default values for regions?
You can establish default values that any non-preconfigured
region will inherit
. The non-predefined region will be
created when you call
# DEFAULT CACHE REGION # sets the default aux value for any non configured caches jcs.default=DC,RFailover jcs.default.cacheattributes= org.apache.stratum.jcs.engine.CompositeCacheAttributes jcs.default.cacheattributes.MaxObjects=1000
The most important line is
How do I define a region?Defining a region involves specifying which auxiliary caches it will use and how many objects it will store in memory. A typical region definition looks like: jcs.region.testCache=DC,RFailover jcs.region.testCache.cacheattributes= org.apache.stratum.jcs.engine.CompositeCacheAttributes jcs.region.testCache.cacheattributes.MaxObjects=1000
The region name is
How do I configure an auxiliary cache?Each auxiliary cache is created through a factory that passes an attribute object to the constructor. The attributes are set via reflection and should be fairly simple to understand. Each auxiliary cache will be fully documented. Plugging in your own auxiliary cache become a simple matter given the reflexive manner of initialization. The most important settings for common usage are the disk path and the remote cache location. It is recommended that only disk and remote auxiliaries be used. The lateral caches are functional but not as efficient. The default configuration code above specifies that non-preconfigured caches use the auxiliary cache by the name DC. This cache is defined in the third section of the file: jcs.auxiliary.DC= org.apache.stratum.jcs.auxiliary.disk.DiskCacheFactory jcs.auxiliary.DC.attributes= org.apache.stratum.jcs.auxiliary.disk.DiskCacheAttributes jcs.auxiliary.DC.attributes.DiskPath=c:/dev/cache/raf
The only thing that needs to be set here is the
The default region is also set to use an auxiliary called
jcs.auxiliary.RFailover= org.apache.stratum.jcs.auxiliary.remote.RemoteCacheFactory jcs.auxiliary.RFailover.attributes= org.apache.stratum.jcs.auxiliary.remote.RemoteCacheAttributes jcs.auxiliary.RFailover.attributes.RemoteTypeName=LOCAL jcs.auxiliary.RFailover.attributes.FailoverServers= localhost:1102,localhost:1101
If you don't have more than one remote server running, just
specify it by itself in the
|