Config: ClusterCache

From Resin 4.0 Wiki

Revision as of 03:07, 18 October 2013 by Cowan (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Gears-48.pngSquirrel-48.png

ClusterCache

A cache which stores consistent copies on the cluster segment.

Using the cache is like using java.util.Map. To add a new entry, call cache.put(key, value). To get the entry, call cache.get(key).

The cache configuration affects the lifetime, local caching timeouts and consistency.

ClusterCache is a javax.cache.Cache (JSR 107: JCache)

Example resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin" xmlns:ee="urn:java:ee">

  <resin:ClusterCache ee:Named="myCache">
    <name>myCache</name>
    <modified-expire-timeout>1h</modified-expire-timeout>
  </resin:ClusterCache>

</web-app>

<resin:ClusterCache> Attributes

Name Description Type Default
name A name is mandatory and must be unique among open caches String required
manager-name String Null
cache-loader CacheLoader that the Cache can then use to populate cache misses from a reference store (database) javax.cache.CacheLoader Null
read-through Use CacheLoader Boolean False
read-through-expire-timeout Period Infinity
cache-writer CacheWrite that the Cache can then use to save cache misses from a reference store (database) javax.cache.CacheWriter Null
write-through Use CacheWriter Boolean False
cache-reader-writer Sets the CacheLoader and CacheWriter which the Cache can then use to populate cache misses from a reference store (database) javax.cache.CacheLoader, javax.cache.CacheWriter Null
serializer Assign the serializer used on values. (This setting should not be changed after a cache is created) com.caucho.distcache.CacheSerializer Null
accessed-expire-timeout The maximum idle time for an item, which is typically used for temporary data like sessions. For example, session data might be removed if idle over 30 minutes. Cached data would have infinite idle time because it doesn't depend on how often it's accessed. Period Infinity
idle-timeout Deprecated - use accessed-expire-timeout Period Infinity - accessed-expire-timeout-window Idle check window, used to minimize traffic when updating access times Period accessed-expire-timeout / 4
modified-expire-timeout The maximum valid time for an item. Items stored in the cache for longer than the expire time are no longer valid and will return null from a get Period Infinity
lease-expire-timeout The lease timeout is the time a server can use the local version if it owns it, before a timeout Period 5m
local-expire-timeout The local read timeout is how long a local copy of a cache item can be reused before checking with the master copy. A read-only item could be infinite (-1). A slow changing item like a list of bulletin-board comments could be 10s. Even a relatively quickly changing item can be 10ms or 100ms. Period 250ms
local-read-timeout Deprecated - use local-expire-timeout Period 250ms
scope-model LOCAL|CLUSTER CLUSTER
backing Same effect as cache-reader-writer com.caucho.server.distcache.CacheBacking Null
Personal tools
TOOLBOX
LANGUAGES