Our CFColdboxProvider
is an implementation specifically written for Adobe ColdFusion 11 and beyond. This provider leverages the EHCache engine within ColdFusion 11 and extends the native ColdFusion capabilities by talking to the EHCache sessions natively via Java. In this manner we are able to do things like:
Get extended cached object metadata
Get overall cache statistics
Talk to terracotta classes
Do quiet operations on get, clear, and put
Check if an element is expired
Do reporting and content reporting
Much more
Each CacheBox provider can have its own set of configuration properties it needs for operation. Our CF providers also have some. Please note, all properties other than "cacheName" are passed through to the underlying EHCache implementation in ColdFusion. The default values may differ if you have edited the ehcache.xml
file on your server.
Info Please note that you can configure more than 1
CFColdboxProvider
cache engine in your applications that can talk to more than one referenced ColdFusion (EHCache) custom cache.
The CacheBox provider is our very own enterprise cache implementation that has been part of the core since its initial baby step versions. Our caching engine has matured over the years and it has been proven effective, fast, scalable and very user friendly. Here are the two implementations for our CacheBox provider:
CacheBoxProvider
: Our base CacheBox provider caching engine
CacheBoxColdBoxProvider
: A subclass of CacheBoxProvider
that enables caching operations for ColdBox applications
Coldbox ships with the following eviction policies
LRU (Least Recently Used)
LFU (Least Frequently Used)
FIFO (First In First Out)
LIFO (Last In First Out)
Custom: You can also build your own and pass the instantiation path in this setting
ColdBox ships with the following object stores:
ConcurrentStore - Uses concurrent hash maps for increased performance
ConcurrentSoftReferenceStore - Concurrent hash maps plus java soft references for JVM memory sensitivity
DiskStore - Uses a physical disk location for caching (Uses java serialization for complex objects)
JDBCStore - Uses a JDBC datasource for caching (Uses java serialization for complex objects)
Custom : You can also build your own and pass the instantiation path in this setting
Please also note that each of the object stores can have extra configuration properties that you will need to set. So for that, let's delve a little deeper into object stores.
Property
Type
Required
Default
Description
cacheName
string
false
object
The named cache to talk to via ColdFusion cache operations. By default we talk to the default ColdFusion object cache.
clearOnFlush
boolean
false
true
Sets whether the MemoryStore should be cleared when flush() is called on the cache
diskExpiryThreadIntervalSeconds
integer
false
120 (2 minutes)
The interval in seconds between runs of the disk expiry thread.
diskPersistent
boolean
false
false
Specifies whether to persist caches stored on disk through JVM restarts.
diskSpoolBufferSizeMB
integer
false
30
The size of the disk spool used to buffer writes
external
boolean
false
false
Specifies whether no timeout or idletime applies. A true value indicates that the object or page is cached without any timespan being specified.
maxElementsInMemory
integer
fasle
10000
The maximum number of objects that can be cached in memory. If the number is exceeded and overflowtodisk is false, the new objects entered replace old elements using algorithm specified in the memoryevictionpolicy entry.
maxElementsOnDisk
integer
false
10000000
The maximum number of objects that can be stored on disk if overfllowtodisk is true.
memoryEvictionPolicy
string
false
LRU
The algorithm to used to evict old entries when maximum limit is reached, such as LRU (least recently used) or LFU (least frequently used).
overflowToDisk
boolean
false
false
Specifies whether when the maximum number of elements allowed in memory is reached, objects can be moved to disk, as determined by the memoryevictionpolicy value.
timeToIdleSeconds
integer
false
86400
The idle time in seconds. Used if a cfcache tag does not specify an idleTime attribute.
timeToLiveSeconds
integer
false
86400
The timeout time in seconds. Used if a cfcache tag does not specify a timespan attribute.
Key
Type
Required
Default
Description
ObjectDefaultTimeout
numeric
false
60
The default lifespan of an object in minutes
ObjectDefaultLastAccessTimeout
numeric
false
30
The default last access or idle timeout in minutes
UseLastAccessTimeouts
Boolean
false
true
Use or not idle timeouts
ReapFrequency
numeric
false
2
The delay in minutes to produce a cache reap (Not guaranteed)
FreeMemoryPercentageThreshold
numeric
false
0
The numerical percentage threshold of free JVM memory to have available before caching. If the JVM free memory falls below this setting, the cache will run the eviction policies in order to cache new objects. (0=Unlimited)
MaxObjects
numeric
false
200
The maximum number of objects for the cache
EvictionPolicy
string or path
false
LRU
The eviction policy algorithm class to use.*
EvictCount
numeric
false
1
The number of objects to evict once an execution of the policy is requested. You can increase this to make your evictions more aggressive
objectStore
string
false
ConcurrentStore
ConcurrentStore The object store to use for caching objects.**
ColdboxEnabled
Boolean
false
false
A flag that switches on/off the usage of either a plain vanilla CacheBox provider or a ColdBox enhanced provider. This must be true when used within a ColdBox application and it applies for the default cache ONLY.
resetTimeoutOnAccess
Boolean
false
false
If true, then when cached objects are retrieved their timeout will be reset to its original value and thus elongating the survival strategy of the items. Much how session storages work.
Ortus Solutions, the makers of CacheBox, have created a commercial extension for the open source CFML engines Railo and Lucee to support caching distribution features via Couchbase (https://www.ortussolutions.com/products/couchbase-lucee).
The Ortus Couchbase Extension is a Railo Server Extension that allows your server to natively connect to a Couchbase NoSQL Server cluster and leverage it for built-in caching, session/client storage and distribution, and much more. With our extension you will be able to scale and extend your Railo CFML applications with ease.
The extension will enhance your Lucee server with some of the following capabilities:
Store session/client variables in a distributed Couchbase cluster
Get rid of sticky session load balancers, come to the round-robin world!
Session/client variable persistence even after Railo restarts
Ability to leverage the RAM resource virtual file system as a cluster-wide file system
Cache connection capabilities for providing distributed & highly scalable query, object, template, function caching
We have shipped CacheBox with several CacheBox providers that you can use in your applications. There are basically two modes of operation for a CacheBox provider and it is all determined by the interface they implement:
ICacheProvider
: A standalone cache provider
IColdboxApplicationCache
: A cache provider for usage by the ColdBox Framework
The following are the shipped providers:
Each provider has the shared functionality provided by the ICacheProvider and IColdboxApplicationCache interfaces, so I encourage you to look at the CFC API Docs for an in-depth view of their API. Also, please note that each cache provider implementation has also some extra methods and functionality according to their implementation, so please check out the API docs for each provider.
Provider
ColdBox Enabled
Reporting Enabled
Description
CacheBoxProvider
false
true
Our very own CacheBox caching engine
CacheBoxColdBoxProvider
true
true
Our CacheBox caching engine prepared for ColdBox application usage
CFProvider
false
true
A ColdFusion 9.0.1 and above implementation
CFColdBoxProvider
true
true
A ColdBox enhanced version of our ColdFusion 9.0.1 cache provider
LuceeProvider
false
true
A ColdBox enhanced version of our Lucee cache provider
LuceeColdBoxProvider
true
true
A ColdBox enhanced version of our Lucee cache provider
MockProvider
true
false
A ColdBox enhanced cache provider that can be used for mocking or testing
Property
Type
Required
Default
Description
cacheName
string
false
object
The named cache to talk to via Lucee cache operations. By default we talk to the default Lucee object cache.