SpringCache
Spring 缓存(Spring Cache)是 Spring 提供的一套基于注解的缓存抽象机制,常用于提升系统性能、减少重复查询数据库或接口调用。 ✅ 一、基本原理Spring Cache 通过对方法的返回结果进行缓存,后续相同参数的调用将直接从缓存中读取,而不是再次执行方法。 常用的注解: 注解 说明 @EnableCaching 开启缓存功能 @Cacheable 有缓存则用缓存,无缓存则调用方法并缓存结果 @CachePut 每次执行方法,并将返回结果放入缓存(更新缓存) @CacheEvict 清除缓存 @Caching 组合多个缓存操作注解 ✅ 二、使用示例1. 添加依赖(使用 Caffeine 举例)123456789<dependency> <groupId>org.springframework.boot</groupId> ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment
hexo
Hello World!Welcome to [Hexo]
