Skip to content

Add property to enable Caffeine async cache mode - #51844

Open
harrisleesh wants to merge 1 commit into
spring-projects:mainfrom
harrisleesh:caffeine-async-cache-mode
Open

harrisleesh wants to merge 1 commit into
spring-projects:mainfrom
harrisleesh:caffeine-async-cache-mode

Conversation

@harrisleesh

Copy link
Copy Markdown

CaffeineCacheManager supports asynchronous caches backed by Caffeine's AsyncCache via setAsyncCacheMode(true) (since Framework 6.1), which adds support for Cache.retrieve — the non-blocking retrieval path used by @Cacheable for CompletableFuture/reactive return types.

The cache auto-configuration only exposed spring.cache.caffeine.spec, so enabling async cache mode previously required a custom CaffeineCacheManager bean or a CacheManagerCustomizer.

This adds a spring.cache.caffeine.async property (default false), wired to CaffeineCacheManager.setAsyncCacheMode(...) in CaffeineCacheConfiguration, plus tests (async enabled exposes the AsyncCache; default keeps the synchronous cache) and a short reference-docs note.

Opened alongside gh-51843 — happy to hold or adjust pending your decision there.

See gh-51843

CaffeineCacheManager supports asynchronous caches backed by Caffeine's
AsyncCache via setAsyncCacheMode, which adds support for Cache.retrieve.
The cache auto-configuration only exposed spring.cache.caffeine.spec, so
enabling async cache mode required a custom CaffeineCacheManager bean or
a CacheManagerCustomizer.

Add a spring.cache.caffeine.async property (default false) wired to
CaffeineCacheManager.setAsyncCacheMode in CaffeineCacheConfiguration.

See spring-projectsgh-51843

Signed-off-by: seonghun lee <harrisleesh@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants