BoxCache Provider
The BoxCache Provider is BoxLang's default, high-performance cache implementation.
Overview
Accessing the BoxCache Provider
// Get the default cache (usually BoxCache provider)
defaultCache = cache();
// Get a named BoxCache instance
userCache = cache("userSessions");
productCache = cache("productCatalog");
// Check cache type
println( "Cache type: " & cache().getType() ); // Outputs: BoxLangCore Storage Operations
Setting Data
Getting Data
Get-or-Set Pattern
Clearing Data
Key Management and Filtering
Getting Cache Keys
Using Cache Filters
Lookup Operations
Statistics and Monitoring
Configuration and Properties
Async Operations
Cache Maintenance
Manual Maintenance Operations
Automatic Maintenance
Event Integration
Practical Usage Patterns
User Session Management
API Response Caching
Database Query Caching
Multi-Level Caching
Performance Optimization
Efficient Key Design
Batch Operations
Memory Management
Error Handling and Resilience
Graceful Degradation
Health Checks
Best Practices
1. Key Naming Conventions
2. Appropriate Timeouts
3. Memory Efficiency
4. Strategic Cache Warming
Conclusion
Last updated
Was this helpful?
