1
0
Fork 0
mirror of synced 2026-10-10 04:27:37 +00:00
Lucee Redis Cache Extension
  • ColdFusion 95%
  • Shell 5%
Find a file
michaeloffner 177d3c0b46
Merge pull request #22 from GianTschingt/LDEV-6541-unix-socket
LDEV-6541 Redis: support connecting via Unix domain socket
2026-10-09 17:31:16 +02:00
.github/workflows Merge pull request #22 from GianTschingt/LDEV-6541-unix-socket 2026-10-09 17:31:16 +02:00
build LDEV-6541 Redis: support connecting via Unix domain socket 2026-10-09 00:34:06 +02:00
source LDEV-6541 Redis: support connecting via Unix domain socket 2026-10-09 00:34:06 +02:00
tests LDEV-6541 Redis: support connecting via Unix domain socket 2026-10-09 00:34:06 +02:00
.gitignore Resolve the extension version automatically like Lucee core (LDEV-6516) 2026-10-09 16:45:47 +02:00
build.xml Migrate Redis extension from OSGi to Maven-based build (4.2.0.0-ALPHA) 2026-07-01 17:51:04 +02:00
CHANGELOG.md LDEV-6541 Redis: support connecting via Unix domain socket 2026-10-09 00:34:06 +02:00
copy-parent-poms.sh Migrate Redis extension from OSGi to Maven-based build (4.2.0.0-ALPHA) 2026-07-01 17:51:04 +02:00
maven-install.sh Migrate Redis extension from OSGi to Maven-based build (4.2.0.0-ALPHA) 2026-07-01 17:51:04 +02:00
maven-settings.xml add maven build 2024-06-25 14:23:45 +02:00
pom.xml Resolve the extension version automatically like Lucee core (LDEV-6516) 2026-10-09 16:45:47 +02:00
README.md Merge pull request #22 from GianTschingt/LDEV-6541-unix-socket 2026-10-09 17:31:16 +02:00

Lucee Redis Cache Extension

Java CI

Issues: https://luceeserver.atlassian.net/issues/?jql=labels%20%3D%20redis

Docs: https://docs.lucee.org/categories/cache.html

For performance, the Redis extension stores data using BSON

The Redis extension previously used Jedis.

Please provide your feedback.

Versions

  • 4.2.x is for Lucee 7.1+ only, Maven-based extension build (no OSGi bundling)
  • 4.0.x-4.1.x is for Lucee 6 and 7+ (dual javax/jakarta tag classes), OSGi bundle-based build
  • 3.x is for Lucee 5.4 and 6, for Javax based sevlet engines (Tomcat 9)

Installation

Install the extension from the Lucee extension store in Lucee admin. Please note that the extension is installable only in the server admin. This means that is not possible to install it for a single web context.

Create and configure the cache

Create a new cache selecting Redis Cache as Type.

Add some configuration:

  • If you like you can use the driver to store the Session Scope. If this is your intention you can flag "Allow to use this cache as client/session storage."
  • Server/Host => Tells Lucee how to connect to Redis. By default this is set to localhost:6379. Please tune this following your environment's needs. Note that the driver actually support a single Redis Server.
  • Namespace => choose the namespace that will be used to avoid keys name clashing between differents cache instances.

All set. You are done.

Connecting via a Unix domain socket

If Redis listens on a Unix domain socket (unixsocket in redis.conf), for example a socket file shared with the Lucee container through a volume, set the "Socket path" field in the admin, or the socket key in the cache definition, to the absolute path of the socket file:

this.cache.connections["redis"] = {
	class: "lucee.extension.io.cache.redis.simple.RedisCache",
	custom: {
		socket: "/tmp/redis/redis.sock",
		username: "lucee",   // optional, ACL user
		password: "secret"   // optional
	}
};
  • When socket is set, host, port and ssl are ignored (TLS does not apply to a local socket). Username/password authentication and databaseIndex work as usual.
  • Requires Java 16 or newer.
  • The Lucee process needs read/write permission on the socket file (see unixsocketperm in redis.conf).
  • socketTimeout only applies to TCP connections; connecting to a local socket fails or succeeds immediately.

Important

  • Metadata:

    • The cache will return only the hits count for any single key.
    • The general counter (missed, hits) for the cache instance itself are not updated
  • idletime: Not supported. Any passed value will be ignored. Timespan is fully supported.

Building

To build the extension, run mvn package in the root directory

Versioning and releases

The version is not edited by hand. pom.xml uses a CI-friendly ${revision} built from extension.version.base (e.g. 4.2.0), a build number and extension.version.qualifier (e.g. -ALPHA).

  • Local, PR and normal master builds use build number 0 (e.g. 4.2.0.0-ALPHA) and publish nothing.
  • A release build (push to master with [release] in the commit message, or a manual run with deploy checked) takes the highest existing build of the base, from the git tags and from Maven Central, adds 1, publishes that version (e.g. 4.2.0.1-ALPHA) and creates the tag 4.2.0.1.
  • A -SNAPSHOT qualifier publishes to the Central snapshot repository, any other qualifier (or none) publishes a release.
  • To start a new line change extension.version.base; for a stable line set extension.version.qualifier to empty.