What problem does it solve?
Provide a robust, production-ready caching layer for CFML applications running CacheBox outside of ColdBox, removing the complexity of installing, configuring, and managing cache lifecycle, eviction, and persistence across restarts.
Core Features & Use Cases
- Flexible installation and bootstrap: install CacheBox, map libraries, and create a CacheFactory in Application.cfc or programmatically.
- Named caches and providers: define multiple caches with different providers and object stores (ConcurrentStore, ConcurrentSoftReferenceStore, DiskStore, JDBCStore) per domain.
- Eviction and resilience: configure eviction policies (LRU, LFU, FIFO, LIFO), TTL and last-access timeouts, and implement stampede-protection patterns and getOrSet usage.
- Persistence and clustering options: use DiskStore or JDBCStore for restart-surviving caches and small clustered deployments.
- Operational controls: schedule manual reaping in onRequestStart, expose getStats/getKeys for monitoring, register listeners for cache events, and call shutdown() on application end for safe shutdown.
- Use Case: warm query caches on startup, store large serialized objects on disk, or provide memory-sensitive view caches with soft-reference stores.
Quick Start
Bootstrap a CacheFactory in your Application.cfc with scopeRegistration set to application and call application.cacheBox.reapAll() on each request to enable standalone CacheBox lifecycle management.