GithubHelp home page GithubHelp logo

focusn / layering-cache Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaolyuh/layering-cache

0.0 0.0 0.0 1.01 MB

为监控而生的分布式多级缓存框架

License: Other

Java 75.76% HTML 16.22% CSS 1.98% JavaScript 6.05%

layering-cache's Introduction

layering-cache

简介

Maven Central License

layering-cache是一个支持分布式环境的多级缓存框架,使用方式和spring-cache类似,主要目的是在使用注解的时候支持配置过期时间。layering-cache其实是一个两级缓存,一级缓存使用Caffeine作为本地缓存,二级缓存使用redis作为集中式缓存。并且基于redis的Pub/Sub做缓存的删除,所以它是一个适用于分布式环境下的一个缓存系统。

支持

  • 支持缓存监控统计
  • 支持缓存过期时间在注解上直接配置
  • 支持二级缓存的自动刷新(当缓存命中并发现缓存将要过期时会开启一个异步线程刷新缓存)
  • 刷新缓存分为强刷新和软刷新,强刷新直接调用缓存方法,软刷新直接改缓存的时间
  • 缓存Key支持SpEL表达式
  • 新增FastJsonRedisSerializer,KryoRedisSerializer序列化,重写String序列化。
  • 支持同一个缓存名称设置不同的过期时间
  • 输出INFO级别的监控统计日志
  • 二级缓存是否允许缓存NULL值支持配置
  • 二级缓存空值允许配置时间倍率

文档

中文文档

打开监控统计功能

打开监控统计功能

打开内置的监控页面

打开内置的监控页面

重要提示

  • layering-cache支持同一个缓存名称设置不同的过期时间,但是一定要保证key唯一,否则会出现缓存过期时间错乱的情况
  • 删除缓存的时候会将同一个缓存名称的不同的过期时间的缓存都删掉
  • 在集成layering-cache之前还需要添加以下的依赖,主要是为了减少jar包冲突(依赖jar列表)。
  • redis的key序列化方式必须StringRedisSerializer

更新日志

更新日志

实现原理

实现原理

作者信息

作者博客:https://xiaolyuh.blog.csdn.net/

作者邮箱: [email protected]

github 地址:https://github.com/wyh-chenfeng/layering-cache

捐赠

项目的发展离不开你的支持,请作者喝杯咖啡吧!

微信-支付宝

layering-cache's People

Contributors

xiaolyuh123 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.