Skip to content
Bluetape4k docs1.11

Configuration, codecs, and TTL

Latest stable Based on Bluetape4k release 1.11.0

Provider settings use the hibernate.cache.lettuce. prefix.

SettingDefaultMeaning
redis_uriredis://localhost:6379Redis endpoint
codeclz4foryValue serialization and compression
use_resp3trueRESP3 for CLIENT TRACKING
local.max_size10000L1 entries per region
local.expire_after_write30mL1 write expiry
redis_ttl.default120sDefault L2 TTL
redis_ttl.<region>noneRegion TTL override
local.record_statsfalseRecord Caffeine statistics

Booleans accept only true or false. Durations support 500ms, 90s, 15m, and 2h; no suffix means seconds. Invalid text and non-positive sizes or durations fail before cache creation.

hibernate.cache.lettuce.redis_ttl.default=120s
hibernate.cache.lettuce.redis_ttl.io.example.Product=300s
hibernate.cache.lettuce.redis_ttl.io.example.Order=600s

A region override wins over the default. L1 expiry and Redis TTL are independent: an L1 miss may refill from Redis, while an L2 miss continues to the database.

The default-update-timestamps-region always has a null Redis TTL. Expiring timestamps before cached query results would undermine stale-result detection.

Supported names are jdk, kryo, and fory, plus gzip, lz4, snappy, and zstd combinations. Names are case-insensitive, but typos never fall back silently.

Compression trades CPU for payload size. Measure representative entity sizes and latency rather than assuming compressed codecs are faster.

Kryo and Fory reconstruct objects from Redis bytes. Isolate the Redis network, require authentication and ACLs, and do not share arbitrary write access with untrusted applications.

JDK serialization is not an allowlist-based Jackson serializer. A misleading 1.11.0 KDoc phrase associates jdk with Jackson, but the actual implementation calls LettuceBinaryCodecs.jdk(); this manual follows the code.