What problem does it solve?
ColdBox applications need predictable, performant caching for data, rendered output, and view fragments while avoiding stampede, cross-key collisions, and per-process limitations in multi-node deployments.
Core Features & Use Cases
- CacheBox configuration: configure default and named caches via config/CacheBox.cfc or inline ColdBox.cfc DSL and choose providers like ConcurrentStore, ConcurrentSoftReferenceStore, engine-native caches, or Redis.
- Injection & API: inject caches using WireBox (cachebox:name), access getCache()/getCacheBox() in handlers, and use core methods like get, set, getOrSet, clearByKeySnippet, and getStats.
- Output & Fragment Caching: support full event output caching with setEventCacheableEntry and fine-grained view fragment caching with renderView(cache=true), plus cache listener interceptors for warming and monitoring.
- Use Case: add a products cache with long TTL for catalogs, use template cache for rendered pages, invalidate list caches on writes, and configure Redis for multi-server session caching.
Quick Start
Configure CacheBox for a ColdBox app to add a Redis-backed sessions cache, a long‑TTL products cache, and inject named caches into your ProductService.