Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何获取缓存到redis里key的全名,否则通过 模糊匹配性能太差。 #930

Open
zhangxiangfeng opened this issue Sep 26, 2024 · 5 comments

Comments

@zhangxiangfeng
Copy link

背景:

  1. 在order服务使用了@cached 进行了缓存,key是el表达式动态计算的。
  2. 在admin服务 活动变更的时候,清楚order这个缓存

问题:

  1. 因为是spel动态计算的,所以仅知道缓存的前缀。
  2. 在admin服务清理的时候 通过 模糊匹配性能太差。
@areyouok
Copy link
Collaborator

如果想批量失效可以换个前缀,否则没有直接的办法。

@zhangxiangfeng
Copy link
Author

zhangxiangfeng commented Sep 26, 2024

如果想批量失效可以换个前缀,否则没有直接的办法。

换个key前缀,也不行,因为要模糊匹配前缀了。性能贼差。集群里 百万级别+的key

@zhangxiangfeng
Copy link
Author

目前我只能采用了不优雅的手段先实现业务了。

重写
com.alicp.jetcache.redisson.RedissonCache#do_PUT

@areyouok
Copy link
Collaborator

你拼el的时候换个前缀不行吗

@lingfengcoder
Copy link

可以看看我fork出来并增强的版本,支持批量删除
image
坐标:https://github.com/lingfengcoder/jetcache/tree/2.7.8-GM-SNAPSHOT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants