Configuration
Learn how to configure the extension for operation
Once the extension is installed, you can begin to create cache connections and configure them either via the administrator, via the Application.cfc or via a CFConfig json file.

To add a new cache, click on
Services > Cache
and you should see a list of existing caches. If there are no existing caches, you should be taken straight to the create
screen.
Creating a cache connection
You have two cache options with our extension:
- Ortus Redis Cache : For standalone or connecting to a single Redis instance
- Ortus Redis Cluster Cache : For connecting to a Redis Cluster
You will then be taken to a page of options for each of the Redis Cache implementations.

The
RedisCache
is used for connecting to a single instance of Redis. That instance could be replicated, but that's another story. Let's check out the different options:Check the
Storage
box if you want to be able to use this cache for session or client storage distribution.Enter the Redis server IP address or host name.
The port of the Redis server.
The logical database to connect to in Redis. By default we connect to database 0.
The password of the Redis server, if any.
Enable SSL on the connection to the Redis Server.
The time in milliseconds to wait for a connection or throw an exception.
The maximum number of connections to allow to the Redis server.
The maximum number of idle connections to keep in the pool to the Redis server
The default key prefix is
lucee-cache
. This will automatically prefix EVERY single cache item that goes into Redis. This will allow you to avoid collisions if you decide to register many Lucee caches or just to distinguish what comes from which cache connection.By default all cache keys are transformed to lowercase to avoid any casing issues. However, if you want case sensitivity, then turn this option on.
This is a Lucee feature where you can set the cache connection to be the default for all cache operations in Lucee (cacheGet(), cachePut(), etc). This can be one of the following or none at all.


The
RedisClusterCache
is used for connecting to a cluster of Redis instances. This can be using Sentinel, or vanilla clustering or Redis Enterprise or Redis AWS/DigitalOcean. Let's check out the different options:Check the
Storage
box if you want to be able to use this cache for session or client storage distribution.Enter a comma-delimited list of all the IPs or hosts in the cluster. Not all are needed, but you should at least enter some to have redundancy.
The port of the Redis cluster.
The Redis cluster password
The time in milliseconds to wait for a connection or throw an exception.
The timeout for a read of data from the cluster - defaults to the connection timeout
The maximum number of connections to the cluster allowed per pool - defaults to 50
The maximum number of connection attempts to make to the cluster.
The default key prefix is
lucee-cache
. This will automatically prefix EVERY single cache item that goes into Redis. This will allow you to avoid collisions if you decide to register many Lucee caches or just to distinguish what comes from which cache connection.By default all cache keys are transformed to lowercase to avoid any casing issues. However, if you want case sensitivity, then turn this option on.
This is a Lucee feature where you can set the cache connection to be the default for all cache operations in Lucee (cacheGet(), cachePut(), etc). This can be one of the following or none at all.
\

You can also add cache connections via your
Application.cfc
and avoid using the admin. Just open your Application.cfc
and create a section under the pseudo-constructor (before the first function)this.cache.connections["sessions"] = {
class: 'ortus.extension.cache.redis.RedisCache',
storage: true,
custom: {
"host":"127.0.0.1",
"port":"6379"
"password":"",
"database" : "0",
"useSSL": false,
"timeout" : 2000,
"maxConnections": 1000,
"idleConnections": 10,
"keyprefix":"lucee-cache",
"cacheKeyCaseSensitivity" : false
},
default: 'object'
};
Please refer to the previous section to find out about what the custom options mean.
this.cache.connections[ "myClusterCache" ] = {
class: 'ortus.extension.cache.redis.RedisClusterCache',
storage: true,
custom: {
"hosts":"127.0.0.1",
"port":"7000",
"password":"",
"timeout" : 2000,
"maxAttempts" : 10,
"maxConnections": 1000,
"keyprefix":"lucee-cluster",
"cacheKeyCaseSensitivity" : false
},
default: 'object'
};
You can also leverage a
cfconfig.json
file to store the cache configurations and automatically load them into your CFML server via CommandBox.{
"adminPassword" : "redis",
"systemErr":"System",
"systemOut":"System",
"applicationTimeout":"1,0,0,0",
"cacheDefaultObject":"sessions",
"caches":{
"sessions":{
"class":"ortus.extension.cache.redis.RedisCache",
"custom":{
"host":"127.0.0.1",
"keyprefix":"lucee-cache",
"port":"6379"
},
"readOnly":"false",
"storage":"true"
},
"rediscluster":{
"class":"ortus.extension.cache.redis.RedisClusterCache",
"custom":{
"hosts":"127.0.0.1",
"keyprefix":"lucee-cluster",
"port":"7000"
},
"readOnly":"false",
"storage":"true"
}
},
"inspectTemplate":"always",
"requestTimeout":"0,0,0,50",
"sessionMangement":"yes",
"sessionTimeout":"0,0,30,0"
}
Please refer to the previous section to find out about what the custom options mean.
Last modified 1mo ago