当前位置:网站首页>Redis implements the browsing history module
Redis implements the browsing history module
2022-07-27 13:55:00 【The sea is high and soft】
Only keep n Historical data
redisTemplate.opsForList().remove("History:" + userid, 1, albumid); // First delete this element from the list
if (redisTemplate.opsForList().size("History:" + userid) <= 3) {
redisTemplate.opsForList().leftPush("History:" + userid, albumid);
} else {
// Only the latest historical data is retained 3 strip , exceed 3 strip , Then bounce out
redisTemplate.opsForList().rightPopAndLeftPush("History:" + userid, albumid);
}If you keep the latest 30 Days of , Suggest using zset Set implementation
FR: Xu Haitao (hunk xu)
QQ Technology exchange group :386476712
边栏推荐
- 2、Citrix Virtual Apps and Desktops 2203剪贴板重定向策略
- Egg swagger doc graphic verification code solution
- Browser kernel module composition
- The salary level of programmers in various countries is a little miserable
- Product manager experience 100 (XI) - Strategic Product Manager: model and methodology
- Image features and extraction
- Selenium eight elements positioning and relative locator
- 认知篇----硬件工程师的成才之路之经典
- Seata's landing practice in ant International Banking
- 13、用户web层服务(一)
猜你喜欢

Redis cluster setup - use docker to quickly build a test redis cluster

Conditions and procedures of futures account opening

小程序毕设作品之微信校园洗衣小程序毕业设计成品(8)毕业设计论文模板

记账软件如何查看收入支出

Image features and extraction

不需要标注数据的语义分割!ETH&鲁汶大学提出MaskDistill,用Transformer来进行无监督语义分割,SOTA!...

小程序毕设作品之微信校园洗衣小程序毕业设计成品(4)开题报告
![[C Advanced] pointer array vs array pointer](/img/1e/33f9cc9446dcad8cdb78babbb5a22c.jpg)
[C Advanced] pointer array vs array pointer

图像特征及提取

网络异常流量分析系统设计
随机推荐
new的多种使用方法
【C进阶】指针数组 VS 数组指针
Jianzhi offer 07 rebuild binary tree -- construct binary tree from middle order and post order traversal sequence
Common distributed theories (cap, base) and consistency protocols (gosssip, raft)
Hcip - OSPF comprehensive experiment
ThinkPHP+宝塔运营环境实现定时任务
Verilog's system tasks - $fopen, $fclose and $fddisplay, $fwrite, $fstrobe, $fmonitor
Training in the second week of summer vacation on July 24, 2022
Browser kernel module composition
基于C语言实现线性表的建立、插入、删除、查找等基本操作
MySQL高可用实战方案——MHA
LeetCode报错及其解决方案
Huiliang technology app is a good place to go to sea: after more than ten years of popularity, why should the United States still choose to go to sea for gold
Network packet loss, network delay? This artifact helps you get everything done!
【实习经验】Date工具类中添加自己实现的方法
[leetcode] 592. Fraction addition and subtraction
2022ACM夏季集训周报(四)
建议收藏,PMP应战篇(2)之易混淆知识点
产品经理经验谈100篇(十一)-策略产品经理:模型与方法论
2、Citrix Virtual Apps and Desktops 2203剪贴板重定向策略