Skip to content
Ben Manes edited this page Dec 20, 2015 · 30 revisions

JSR-107 JCache is a standardized caching API that is Java 6 compatible and introduced in JEE 8. Caffeine provides a local in-memory implementation. The JCache provider is configured using Typesafe's Config library. See the reference.conf for more details.

Annotation support

To take full advantage of the default template, the DefaultCacheResolverFactory binding should be replaced with a version using Caffeine's defaults. This ensures that your configuration defaults, rather than the specification's, are honored.

Spring

See the Spring documentation.

Prefer using Spring Cache, which includes support for Caffeine as of Spring Framework 4.3 and Spring Boot 1.4.

Guice

The JSR provides an integration module that delegates to the JCache provider.

compile 'org.jsr107.ri:cache-annotations-ri-guice:1.0.0'
Injector injector = Guice.createInjector(new CacheAnnotationsModule());

CDI

The JSR provides an extension that delegates to the JCache provider.

compile 'org.jsr107.ri:cache-annotations-ri-cdi:1.0.0'
Clone this wiki locally