← ClaudeAtlas

cocachelisted

Use when building or modifying Java/Kotlin applications with CoCache two-level distributed coherent caching. Invoke for @CoCache cache interfaces, @JoinCacheable composition, Redis-backed coherence, Spring Boot integration, cache proxy behavior, custom cache backends, cache penetration protection (missing guards), cache breakdown protection, Redis failure policy (strict-failure, missing-guard sentinel), Redis TTL-drift test failures, or CoCache TCK tests.
Ahoo-Wang/skills · ★ 3 · AI & Automation · score 76
Install: claude install-skill Ahoo-Wang/skills
# CoCache Development Guide CoCache is a Java/Kotlin two-level distributed coherent cache framework: - L2 client-side cache: local Map, Guava, or Caffeine cache. - L1 distributed cache: Redis-backed shared cache. - Coherence: `CacheEvictedEventBus` publishes evictions so peer instances invalidate local entries. ## Start Here Choose the smallest reference that fits the request: | Task | Read | |------|------| | Add CoCache to a Spring or Spring Boot app; configure Redis failure behavior or the missing-guard sentinel | `references/setup.md` | | Compose cached values with `@JoinCacheable` | `references/join-cache.md` | | Write or update tests | `references/testing.md` | | Implement a custom L1/L2 cache, event bus, key converter, or source | `references/custom-implementation.md` | ## Repository Rules When editing this repository, follow `AGENTS.md`: - Use `me.ahoo.test.asserts.assert` and `.assert()` in Kotlin tests; do not use AssertJ `assertThat()`. - Extend the TCK specs in `cocache-test` for cache implementations. - Ask before changing `cocache-api` public interfaces or adding dependencies. - Run the relevant Gradle checks before finishing; prefer `./gradlew check` for broad changes. ## Core Model Define one cache interface per cache domain. The interface extends `Cache<K, V>`, is annotated with `@CoCache`, and is registered through `@EnableCoCache`. CoCache creates a proxy at runtime. ```kotlin @CoCache(keyPrefix = "user:", ttl = 120) @GuavaCache(maximumSize = 1_000