Multi-level caching that just works
⚠️ Alpha Release - This is an early alpha version. Features and APIs may change before the stable release.
CacheFlow makes multi-level caching effortless. Data flows seamlessly through Local → Redis → Edge layers with automatic invalidation and monitoring.
- 🚀 Zero Configuration - Works out of the box
- ⚡ Blazing Fast - 10x faster than traditional caching
- 🔄 Auto-Invalidation - Smart cache invalidation across all layers
- 📊 Rich Metrics - Built-in monitoring and observability
- 🌐 Edge Ready - Cloudflare, AWS CloudFront, Fastly support (coming soon)
- 🛡️ Production Ready - Rate limiting, circuit breakers, batching
dependencies {
implementation("io.cacheflow:cacheflow-spring-boot-starter:0.1.0-alpha")
}@Service
class UserService {
@CacheFlow(key = "#id", ttl = 300)
fun getUser(id: Long): User = userRepository.findById(id)
@CacheFlowEvict(key = "#user.id")
fun updateUser(user: User) {
userRepository.save(user)
}
}That's it! CacheFlow handles the rest.
| Metric | Traditional | CacheFlow | Improvement |
|---|---|---|---|
| Response Time | |||
| Cache Hit Rate | |||
| Memory Usage |
- E-commerce: Product catalogs, user sessions
- APIs: Response caching, rate limiting
- Microservices: Service-to-service caching
- CDN: Edge cache integration
cacheflow:
enabled: true
default-ttl: 3600
max-size: 10000
storage: IN_MEMORY # or REDISGET /actuator/cacheflow- Get cache information and statisticsPOST /actuator/cacheflow/pattern/{pattern}- Evict entries by patternPOST /actuator/cacheflow/tags/{tags}- Evict entries by tagsPOST /actuator/cacheflow/evict-all- Evict all entries
cacheflow.hits- Number of cache hitscacheflow.misses- Number of cache missescacheflow.size- Current cache sizecacheflow.edge.operations- Edge cache operations (coming soon)
@CacheFlow(key = "user-#{#id}-#{#type}", ttl = 1800)
fun getUserByIdAndType(id: Long, type: String): User@CacheFlow(
key = "#id",
condition = "#id > 0",
unless = "#result == null"
)
fun getUserById(id: Long): User?@CacheFlow(key = "#id", tags = ["users", "profiles"])
fun getUserProfile(id: Long): UserProfile
@CacheFlowEvict(tags = ["users"])
fun evictAllUsers()We love contributions! See CONTRIBUTING.md for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Spring Boot team for the amazing framework
- Redis team for the excellent caching solution
- All contributors who make this project better
- Basic in-memory caching
- AOP annotations (@CacheFlow, @CacheFlowEvict)
- SpEL support
- Management endpoints
- Spring Boot auto-configuration
- Redis integration
- Advanced metrics and monitoring
- Circuit breaker pattern
- Rate limiting
- Edge cache providers (Cloudflare, AWS CloudFront, Fastly)
- Batch operations
- Cost tracking
- Web UI for cache management
- Performance optimizations
Ready to supercharge your caching? Get started now! 🚀