当前位置: 首页 > news >正文

国外购物网站推荐为什么有人做商城优惠券网站卖

国外购物网站推荐,为什么有人做商城优惠券网站卖,国外 外贸 网站 源码,建筑网片报价公式通用cache模块 项目特点1.保留原框架的集成#xff0c;扩展#xff0c;配置能力2.对于spring-cache增强1.引入核心依赖2.开启多cache配置2.自选缓存pom依赖 二:使用示例1.api示例2.注解示例三:配置说明1.REDISSON_LOCAL_MAP2.REDISSON_2PC 开源地址:https://github.com/28928… 通用cache模块 项目特点1.保留原框架的集成扩展配置能力2.对于spring-cache增强1.引入核心依赖2.开启多cache配置2.自选缓存pom依赖 二:使用示例1.api示例2.注解示例三:配置说明1.REDISSON_LOCAL_MAP2.REDISSON_2PC 开源地址:https://github.com/2892824942/ty-cloud/blob/main/ty-framework/ty-framework-cache 项目特点 1.保留原框架的集成扩展配置能力 集成 通过依赖对应的cache实现可自动装载对应配置扩展 依赖原spring-cache核心能力保留其扩展能力配置 原spring配置同样生效如不使用cache-plus框架能力原生配置不受影响 使用cache-plus相关功能仅更换配置前缀即可 2.对于spring-cache增强 支持多cache同时使用支持Redisson实现的CacheManager自动注入支持具体缓存失效时间配置,全局配置及注解均支持支持二级缓存支持强一致事务缓存 1.引入核心依赖 暂时未发到中央仓库(准备中)… dependencygroupIdcom.ty/groupIdartifactIdty-framework-cache-starter/artifactIdversion${最新版本}/version /dependency 2.开启多cache配置 application.yml示例 application:cache:multi-enable: truetype: redis,caffeineredis:cache-names: test1,test2enable-transactions: truestore-type: key_valuecache-null-values: truenull-value-time-to-live: PT20stime-to-live: PT20muse-key-prefix: truekey-prefix: cachecaffeine:cache-names: caffeine-name2.自选缓存pom依赖 如使用redis缓存,按照Spring Boot data Redis官方配置即可,以下为使用Redisson客户端pom: dependencygroupIdorg.redisson/groupIdartifactIdredisson-spring-boot-starter/artifactId /dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-data-redis/artifactId /dependency正确配置redis示例 redis:host: localhostport: 6379timeout: 1200如使用caffeine缓存,添加如下pom: dependencygroupIdcom.github.ben-manes.caffeine/groupIdartifactIdcaffeine/artifactId /dependency二:使用示例 1.api示例 和常规spring cache一致 Component public class test {AutowiredCacheManager cacheManager;public void cache() {Cache cache cacheManager.getCache(test1);cache.put(aaa, 123);Integer value cache.get(aaa, Integer.class);} }2.注解示例 和spring cache一致 Service Slf4j CacheConfig(cacheNames CacheNameConstant.CAHCE_NAME) public class CapitalAccountCacheService {Autowiredprivate MyCapitalCacheDAO myCapitalDAO;AutowiredLazyprivate CapitalAccountCacheService _self;public ListMyCapitalAccount getAll() {return myCapitalDAO.getAll();}Cacheable(key #id, sync true)public MyCapitalAccount getById(Long id) {MyCapitalAccount byId myCapitalDAO.getById(id);log.info(CapitalAccountCacheService getById from db,myCapitalAccount:{}, byId);return byId;}CachePut(key #myCapitalAccount.id, condition #result.getId()!null#result.getId()0)public MyCapitalAccount insert(MyCapitalAccount myCapitalAccount) {log.info(CapitalAccountCacheService insert to db,myCapitalAccount:{}, myCapitalAccount);myCapitalDAO.insert(myCapitalAccount);return myCapitalAccount;}CachePut(key #myCapitalAccount.id, condition #result!null)public MyCapitalAccount update(MyCapitalAccount myCapitalAccount) {log.info(CapitalAccountCacheService update to db,myCapitalAccount:{}, myCapitalAccount);int update myCapitalDAO.update(myCapitalAccount);if (update 0) {return myCapitalAccount;}return null;}CacheEvict(key #myCapitalAccount.id)public int delete(MyCapitalAccount myCapitalAccount) {log.info(CapitalAccountCacheService delete to db,myCapitalAccount:{}, myCapitalAccount);return myCapitalDAO.deleteById(myCapitalAccount.getId());}CacheEvict(allEntries true)public int deleteAll() {log.info(CapitalAccountCacheService delete All from db);return myCapitalDAO.deleteAll();} } 三:配置说明 除了spring-cache提供的缓存类型外,框架提供redis额外两个实现: REDISSON_2PC, REDISSON_LOCAL_MAP 基于redisssonRLocalMap实现的二级缓存CacheManagerREDISSON_2PC 基于redisson实现的支持强一致性事务的缓存CacheManager1.REDISSON_LOCAL_MAP Redisson官方宣传的,增加了本地的缓存,性能提升最高45倍,适用于对数据一致性要求不高,但访问量较大,对性能要求极高,甚至连网络请求都成为瓶颈的场景 2.REDISSON_2PC 基于redisson实现的支持强一致性事务的缓存CacheManager,整合mysql事务请求,在RR隔离级别下,通过事务线程绑定方式,在本地增加TreadLocal二级缓存, 保证缓存事务过程的可重复读,在mysql事务提交过程,通过redis事务提交或回滚redis相关操作,保证强一致性 更详细的使用案例,见:https://github.com/2892824942/framework-demo
http://www.zqtcl.cn/news/686143/

相关文章:

  • 壶关网站建设中国专利申请网官网
  • 具体的网站建设方案网页程序开发采购
  • 泉州 网站建设苏州网站外包
  • 网站做404页面怎么做网站开发过程的基本环节
  • 做网站是前端还是后端小程序网站模板
  • 学校网站建设与维护建设银行官网电话
  • dedecms网站地图修改软件开发公司规章制度
  • 大型旅游网站骏驰网站开发
  • 有心学做网站两学一做知识竞赛试题网站
  • 西宁圆井模板我自己做的网站怎么做网站能快速赚钱
  • 根据网站集约化建设的要求直流分公司四川建设部网站
  • 网站优化平台有哪些遵义网站开发的公司有哪些
  • 推荐一下网站谢谢微盟微商城怎么样
  • 网站建设的技术指标网站做好第二年要多少钱
  • 工业设计东莞网站建设WordPress网络功能
  • 网站pv多少可以企业网站托管常见问题
  • 深圳有哪些网站建设沈阳做机床的公司网站
  • 2022年网站能用的wordpress 客户端使用
  • 社交网站建设内容如何制作橡皮泥 简单
  • 简述网站的制作流程wordpress定制分类
  • 如何自建购物网站wordpress文章编辑插件
  • 网站策划机构建筑网站、
  • 邹平做网站的公司标志设计图片大全简单
  • 广东省建设厅官方网站多少钱如何在虚拟机里面做网站
  • 上海免费网站建设模板做网站页面的软件
  • 做折页的网站个人网站有哪些
  • 服装网站建设内容wordpress媒体库只能列表
  • 北京好的做网站的公司东莞专业做淘宝网站
  • 网站结构怎么优化wordpress文章列表添加字段
  • 网站建设框架图长沙官网seo技术厂家