cache-refresh-ahead

Spring Boot Cache Refresh Ahead Starter

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

blog.svenbayer
ArtifactId

ArtifactId

cache-refresh-ahead-spring-boot-starter
Last Version

Last Version

1.0.0.RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

cache-refresh-ahead
Spring Boot Cache Refresh Ahead Starter
Project URL

Project URL

https://github.com/SvenBayer/cache-refresh-ahead-spring-boot-starter
Project Organization

Project Organization

Pivotal Software, Inc.
Source Code Management

Source Code Management

http://github.com/SvenBayer/cache-refresh-ahead-spring-boot-starter/tree/master

Download cache-refresh-ahead-spring-boot-starter

How to add to project

<!-- https://jarcasting.com/artifacts/blog.svenbayer/cache-refresh-ahead-spring-boot-starter/ -->
<dependency>
    <groupId>blog.svenbayer</groupId>
    <artifactId>cache-refresh-ahead-spring-boot-starter</artifactId>
    <version>1.0.0.RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/blog.svenbayer/cache-refresh-ahead-spring-boot-starter/
implementation 'blog.svenbayer:cache-refresh-ahead-spring-boot-starter:1.0.0.RELEASE'
// https://jarcasting.com/artifacts/blog.svenbayer/cache-refresh-ahead-spring-boot-starter/
implementation ("blog.svenbayer:cache-refresh-ahead-spring-boot-starter:1.0.0.RELEASE")
'blog.svenbayer:cache-refresh-ahead-spring-boot-starter:jar:1.0.0.RELEASE'
<dependency org="blog.svenbayer" name="cache-refresh-ahead-spring-boot-starter" rev="1.0.0.RELEASE">
  <artifact name="cache-refresh-ahead-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='blog.svenbayer', module='cache-refresh-ahead-spring-boot-starter', version='1.0.0.RELEASE')
)
libraryDependencies += "blog.svenbayer" % "cache-refresh-ahead-spring-boot-starter" % "1.0.0.RELEASE"
[blog.svenbayer/cache-refresh-ahead-spring-boot-starter "1.0.0.RELEASE"]

Dependencies

compile (5)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.0.4.RELEASE
org.springframework : spring-context jar 5.0.8.RELEASE
org.springframework : spring-context-support jar 5.0.8.RELEASE
org.springframework.boot : spring-boot-starter-data-redis Optional jar 2.0.4.RELEASE
com.github.ben-manes.caffeine : caffeine Optional jar 2.6.2

Project Modules

There are no modules declared in this project.

Maven Central Javadocs Project Stats

[Unit Tests CircleCI [Integration Tests CircleCI

[SonarQube]

Cache Refresh Ahead Starter

A Cache Refresh-Ahead Spring Boot Starter for Caffeine and Redis cache!

This starter enables Refresh-Ahead Caching. This enables clients to benefit from the speed of caching while the application keeps the cache closely up-to-date. The client will not feel any impact of the slow source behind the cache.

Supported Cache Frameworks

Currently, only Caffeine and Redis Cache is supported.

Usage

Examples

You can find examples of how to use the library at https://github.com/SvenBayer/cache-refresh-ahead-samples

Preprequisites

You have to add @EnableCaching to your project and define a CacheManager bean.

Setup

Add the Spring Boot starter to your maven pom. Define the expiration of your cache values.

Define the cache refresh intervals in your application.properties/yml. You can either define a global interval, or specify an interval for each cache separately. For example, the first line specifies that the caches are reloaded every 5 seconds. The second line specifies that only the cache named longrun is being reloaded every 5 seconds.

cache.reload.ahead.refresh-ahead-interval=5s
cache.reload.ahead.refresh-ahead-interval-caches.longrun=5s

More Information

Visit my blog at https://svenbayer.blog

Versions

Version
1.0.0.RELEASE