Git Product home page Git Product logo

cache-refresh-ahead-spring-boot-starter's Introduction

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

cache-refresh-ahead-spring-boot-starter's People

Contributors

svenbayer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.