Permalink
e177d5d Jul 5, 2017
1 contributor

Users who have contributed to this file

141 lines (112 sloc) 5.54 KB
# This is the reference configuration file that contains all the default settings.
# Make your edits/overrides in your application.conf.
caffeine.jcache {
# A named cache is configured by nesting a new definition under the caffeine.jcache namespace. The
# per-cache configuration is overlaid on top of the default configuration.
default {
# The required type of the keys
key-type = java.lang.Object
# The required type of the values
value-type = java.lang.Object
# The strategy for copying the cache entry for value-based storage
store-by-value {
# If enabled, the entry is copied when crossing the API boundary
enabled = false
# It is highly recommended that the default strategy be replaced with a higher performance
# alternative (see https://github.com/eishay/jvm-serializers/wiki).
strategy = "com.github.benmanes.caffeine.jcache.copy.JavaSerializationCopier"
}
# The list of configuration paths to the listeners that consume this cache's events
listeners = []
read-through {
# If enabled, the entry is loaded automatically on a cache miss
enabled = false
# The CacheLoader class for loading entries
loader = null
}
write-through {
# If enabled, the entry is written to the resource before the cache is updated
enabled = false
# The CacheWriter class for writing entries
writer = null
}
# The JMX monitoring configuration
monitoring {
# If cache statistics should be recorded and externalized
statistics = false
# If the configuration should be externalized
management = false
}
# The eviction policy for automatically removing entries from the cache
policy {
# The expiration threshold before lazily evicting an entry. This single threshold is reset on
# every operation where a duration is specified. As expected by the specification, if an entry
# expires but is not accessed and no resource constraints force eviction, then the expired
# entry remains in place.
lazy-expiration {
# The duration before a newly created entry is considered expired. If set to 0 then the
# entry is considered to be already expired and will not be added to the cache. May be
# a time duration or "eternal" to indicate no expiration.
creation = "eternal"
# The duration before a updated entry is considered expired. If set to 0 then the entry is
# considered immediately expired. May be a time duration, null to indicate no change, or
# "eternal" to indicate no expiration.
update = "eternal"
# The duration before a read of an entry is considered expired. If set to 0 then the entry
# is considered immediately expired. May be a time duration, null to indicate no change, or
# "eternal" to indicate no expiration.
access = "eternal"
}
# The expiration thresholds before eagerly evicting an entry. These settings correspond to the
# expiration supported natively by Caffeine where expired entries are collected during
# maintenance operations.
eager-expiration {
# Specifies that each entry should be automatically removed from the cache once a fixed
# duration has elapsed after the entry's creation, or the most recent replacement of its
# value. This setting cannot be combined with the variable configuration.
after-write = null
# Specifies that each entry should be automatically removed from the cache once a fixed
# duration has elapsed after the entry's creation, the most recent replacement of its value,
# or its last read. Access time is reset by all cache read and write operation. This setting
# cannot be combined with the variable configuration.
after-access = null
# The expiry class to use when calculating the expiration time of cache entries. This
# setting cannot be combined with after-write or after-access configurations.
variable = null
}
# The threshold before an entry is eligible to be automatically refreshed when the first stale
# request for an entry occurs. This setting is honored only when combined with the
# read-through configuration.
refresh {
# Specifies that active entries are eligible for automatic refresh once a fixed duration has
# elapsed after the entry's creation or the most recent replacement of its value.
after-write = null
}
# The maximum bounding of the cache based upon its logical size
maximum {
# The maximum number of entries that can be held by the cache. This setting cannot be
# combined with the weight configuration.
size = null
# The maximum total weight of entries the cache may contain (requires a weigher). This
# setting cannot be combined with the size configuration.
weight = null
# The weigher class to use when calculating the weight of cache entries
weigher = null
}
}
}
# A catalog of cache listeners; optionally defined in any namespace as referenced by path
listeners {
# An example definition of a listener
example {
# The CacheEntryListener class
class = null
# The CacheEntryEventFilter class that should be applied prior to notifying the listener
filter = null
# If the thread that created the event should block until the listener has completed
synchronous = false
# If the old value should be provided
old-value-required = false
}
}
}