nwwarm/spring-redis-hybrid-cache — reverse-engineered prompt
Reverse engineered prompt
Build me a Spring Boot starter library for hybrid caching that can be dropped into an existing app using normal @Cacheable annotations.
I want it to combine a fast local cache with Redis so read heavy apps can avoid extra Redis calls, but still stay reasonably in sync across multiple running app instances. When one node updates or evicts something, the other nodes should clear their local copy through Redis pub sub. It should also protect against cache stampedes so lots of requests for the same missing key only trigger one real load.
Please include graceful behavior when Redis is slow or down, so the app can keep serving from local cache instead of falling over. Support per cache settings in YAML, like TTL, size, and whether a cache is local only, Redis only, or near cache. Add support for cache clears without scanning every Redis key, stale while revalidate, refresh ahead for hot keys, and async or reactive return types if Spring supports it.
Look up current Spring Boot and Redis docs if needed, and include tests plus a clear README with quick start usage.
Want more depth? Deep Reverse