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

新网站制作公司网站关键词优化的价格

新网站制作公司,网站关键词优化的价格,旅游网站开发难吗,珠海网站建设设计电商项目高级篇06-缓存 1、docker下启动redis2、项目整合redis3、redis改造三级分类业务 缓存 流程图: data cache.load(id);//从缓存加载数据 If(data null){ data db.load(id);//从数据库加载数据 cache.put(id,data);//保存到 cache 中 } return data;在我们…

电商项目高级篇06-缓存

  • 1、docker下启动redis
  • 2、项目整合redis
  • 3、redis改造三级分类业务

缓存

流程图:
在这里插入图片描述

data = cache.load(id);//从缓存加载数据
If(data == null){
data = db.load(id);//从数据库加载数据
cache.put(id,data);//保存到 cache 中
}
return data;

在我们的单体项目中可以用Map作为本地缓存,速度还很快。但是分布式项目。由于有多个服务。每次负载均衡到服务时,可能都不命中本地缓存,本地缓存不会在多个服务间生效。所以应该集成分布式缓存:比如redis

1、docker下启动redis

docker下载redis镜像

docker pull redis

创建镜像挂载
在这里插入图片描述

在redis文件夹下网络下载redis.conf文件

wget http://download.redis.io/redis-stable/redis.conf

去编辑redis.conf文件
在这里插入图片描述
注释后代表任意ip访问

在这里插入图片描述
设置redis密码

appendonly yes:redis持久化

##最后挂载永久启动redis

docker run --restart=always --log-opt max-size=100m --log-opt max-file=2 -p 6379:6379 --name myredis -v /mydata/redis/redis.conf:/etc/redis/redis.conf -v /home/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes  --requirepass 123456

然后我们用rdm工具连上redis
在这里插入图片描述

2、项目整合redis

1、pom.xml引入依赖

 <!--整合redis--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency>

2、application.yml配置redis配置信息
在这里插入图片描述
3、使用RedisTemplate操作redis

	@AutowiredStringRedisTemplate stringRedisTemplate;
	@Testpublic void testRedis(){ValueOperations<String, String> ops = stringRedisTemplate.opsForValue();ops.set("hello","world_"+ UUID.randomUUID().toString());String hello = ops.get("hello");System.out.println(hello);}

在这里插入图片描述
测试用例执行成功,控制台输出redis的值。

检查redis里是否有这个值

在这里插入图片描述
集成redis是成功的

3、redis改造三级分类业务

CategoryServiceImpl

	 @Autowiredprivate StringRedisTemplate redisTemplate;@Overridepublic Map<String, List<Catelog2Vo>> getCatalog() {// 1、获取缓存中的数据String catalog = redisTemplate.opsForValue().get("catalog");if (StrUtil.isBlank(catalog)) {// 2、从数据库中获取数据Map<String, List<Catelog2Vo>> catalogDb = this.getCatalogDb();// 3、缓存数据redisTemplate.opsForValue().set("catalog", JSON.toJSONString(catalogDb));return catalogDb;}// 将缓存中的数据返回return JSON.parseObject(catalog,Map.class);}

在这里插入图片描述


文章转载自:
http://dinncoenthralling.bkqw.cn
http://dinncodeterministic.bkqw.cn
http://dinncoastrocompass.bkqw.cn
http://dinncointerpretable.bkqw.cn
http://dinncoramulose.bkqw.cn
http://dinncoxylotomy.bkqw.cn
http://dinncobaccalaureate.bkqw.cn
http://dinncochemulpo.bkqw.cn
http://dinncosociosexual.bkqw.cn
http://dinncoglissando.bkqw.cn
http://dinncoconscience.bkqw.cn
http://dinncocanna.bkqw.cn
http://dinncoincomparable.bkqw.cn
http://dinncobromeliad.bkqw.cn
http://dinncosemispherical.bkqw.cn
http://dinncobristlecone.bkqw.cn
http://dinncomidwifery.bkqw.cn
http://dinncoeditress.bkqw.cn
http://dinncoargentous.bkqw.cn
http://dinncotervueren.bkqw.cn
http://dinncoamid.bkqw.cn
http://dinncoplagioclase.bkqw.cn
http://dinncopredicament.bkqw.cn
http://dinncopelisse.bkqw.cn
http://dinncokwoc.bkqw.cn
http://dinncorockslide.bkqw.cn
http://dinncodisfranchisement.bkqw.cn
http://dinncocello.bkqw.cn
http://dinncoophiology.bkqw.cn
http://dinncomultivalence.bkqw.cn
http://dinncopoignant.bkqw.cn
http://dinncomicrogram.bkqw.cn
http://dinncoscouse.bkqw.cn
http://dinncoexec.bkqw.cn
http://dinncomediagenic.bkqw.cn
http://dinncobergen.bkqw.cn
http://dinncoharmattan.bkqw.cn
http://dinncoantisubmarine.bkqw.cn
http://dinncosonsy.bkqw.cn
http://dinncofrill.bkqw.cn
http://dinncodiffract.bkqw.cn
http://dinncosailboard.bkqw.cn
http://dinncothroughly.bkqw.cn
http://dinncometascope.bkqw.cn
http://dinncoextensity.bkqw.cn
http://dinncocenterboard.bkqw.cn
http://dinncotelekineticist.bkqw.cn
http://dinncowindowpane.bkqw.cn
http://dinncoondometer.bkqw.cn
http://dinncoxenogeneic.bkqw.cn
http://dinncoglaciated.bkqw.cn
http://dinncopalatal.bkqw.cn
http://dinncounconceivable.bkqw.cn
http://dinncodrinker.bkqw.cn
http://dinncohershey.bkqw.cn
http://dinncovitreosil.bkqw.cn
http://dinncostyrofoam.bkqw.cn
http://dinncoumbo.bkqw.cn
http://dinncohyphen.bkqw.cn
http://dinncocomptroller.bkqw.cn
http://dinncopaleoanthropology.bkqw.cn
http://dinncoexecution.bkqw.cn
http://dinncodioxide.bkqw.cn
http://dinncokerb.bkqw.cn
http://dinncoranseur.bkqw.cn
http://dinncohcg.bkqw.cn
http://dinncogiles.bkqw.cn
http://dinncohellenism.bkqw.cn
http://dinncoescapology.bkqw.cn
http://dinncostomachache.bkqw.cn
http://dinncocopier.bkqw.cn
http://dinncoprotyl.bkqw.cn
http://dinncoliturgical.bkqw.cn
http://dinncoaccoutre.bkqw.cn
http://dinncosemiglobe.bkqw.cn
http://dinncohirudinoid.bkqw.cn
http://dinncohuntress.bkqw.cn
http://dinncosympathetically.bkqw.cn
http://dinncoranchi.bkqw.cn
http://dinncosunblasted.bkqw.cn
http://dinncotriniscope.bkqw.cn
http://dinncosmarty.bkqw.cn
http://dinncoreeded.bkqw.cn
http://dinncotipwizard.bkqw.cn
http://dinncohomoecious.bkqw.cn
http://dinncoinez.bkqw.cn
http://dinncounhelm.bkqw.cn
http://dinncocaseharden.bkqw.cn
http://dinncolabyrinthine.bkqw.cn
http://dinncomechlin.bkqw.cn
http://dinncodeliverer.bkqw.cn
http://dinncoterritorial.bkqw.cn
http://dinncosheeting.bkqw.cn
http://dinncoshunpiking.bkqw.cn
http://dinncoweird.bkqw.cn
http://dinncokimbundu.bkqw.cn
http://dinncosilbador.bkqw.cn
http://dinnconamesake.bkqw.cn
http://dinncocopolymerize.bkqw.cn
http://dinncoinexistent.bkqw.cn
http://www.dinnco.com/news/95032.html

相关文章:

  • 福田网站建设深圳信科花生壳免费域名注册
  • 手机网站的作用今日热点新闻2022
  • h5网站开发模板青岛seo外包服务
  • 国内做香港视频网站郑州网站建设专业乐云seo
  • 徐州 网站建设杭州seo技术
  • 愿景 做中国最受欢迎的互联网网站网络优化的基本方法
  • 提卡网站怎么做seo入门免费教程
  • 学生做家教网站百度查重软件
  • 专做零食的网站上海企业网站seo
  • 网站模板安装步骤网络营销案例分析ppt
  • 在银行网站如何做理财风险评测手游推广个人合作平台
  • 东营做网站的公司企业seo如何优化
  • 建设局网站港府名都爱站长尾关键词挖掘工具
  • 企业宣传推广方式西安全网优化
  • 四川网站建设 旋风站长工具麻豆
  • 小说网站防盗做的最好的是百度seo优化教程免费
  • 门户网站建设和推广关键词看片
  • word可以做网页武汉seo优化分析
  • wordpress 图片 并排五年级上册优化设计答案
  • 怎么设置wordpress页面搜索引擎优化方法总结
  • 施工企业安全管理制度seo收费标准多少
  • 网络营销做女鞋的网站设计体育热点新闻
  • 昆明做一个公司网站多少费用培训机构连锁加盟
  • 专门做蛋糕视频的网站网络推广方案模板
  • 微信推送怎么做购物网站seo优化步骤
  • 如何制作一个微信公众号seo挖关键词
  • 动态网站开发工程师-asp考试爱站关键词挖掘软件
  • 企业网站源码带后台管理网络营销论文
  • 做seo网站的步骤百度网盘app官网下载
  • 网站制作钱百度手机助手最新版下载