Overview
FluxCRUD provides a unifiedCacheManager that works seamlessly with the Repository. It supports:
- In-Memory: Ideal for testing and local dev.
- Redis: Production-grade distributed caching.
- Memcached: Lightweight alternative.
Usage
Configuration
Pass theCacheManager to your Repository or Flux instance.
Automatic Caching
Once configured, theRepository handles caching for you:
- Read-Through:
get(id)checks cache first. If hit, returns instantly. If miss, fetches from DB and sets cache. - Write-Through:
createandupdatewrite to DB and cache. - Invalidation:
deleteremoves the item from cache.
Bulk Operations
TheRepository is smart enough to handle bulk fetches efficiently:

