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

新增清空缓存下所有条目功能 #474

Closed
wants to merge 4 commits into from
Closed

新增清空缓存下所有条目功能 #474

wants to merge 4 commits into from

Conversation

cycle2zhou
Copy link

注解@CacheInvalidate新增allEntries属性,标记缓存name下的所有条目是否全部删除;缓存接口新增clear方法,对应清空缓存功能。

注解@CacheInvalidate新增allEntries属性,标记缓存name下的所有条目是否全部删除;缓存接口新增clear方法,对应清空缓存功能
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


周波 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coveralls
Copy link

coveralls commented May 15, 2020

Coverage Status

Coverage decreased (-1.4%) to 88.785% when pulling 189ec08 on cycle2zhou:master into 0fb364d on alibaba:master.

@areyouok
Copy link
Collaborator

感谢提供PR,不过没有好的办法实现这个功能。

使用keys来获取所有key是不可行的,生产服务器上keys命令都是被禁用的,而且这个提交里面的做法会把其它Cache实例里面的数据也删了。

使用Hashes的HXXX命令会好一些,但这种做法也不具备普适性,如果你需要可以自己定制。

@cycle2zhou
Copy link
Author

好的 明白了 数据量太大对系统和性能影响较大 不太通用 谢谢

@ethanbing
Copy link

这个非常需要,希望尽快发布这个功能,谢谢
目前都是手动操作删除

@cycle2zhou cycle2zhou closed this Jun 27, 2020
@mooncake020
Copy link

同样需要这个功能 spring-cache支持的这个功能 你可以考虑贵公司的生产环境不允许通配符删除 但是你不能否认确实有很多用户有这个需求

@mooncake020
Copy link

经过实验 是可以通过spring-cache 的CacheEvict 注解清理jetcache的缓存的 。本来打算用jetcache完全替换springcache 现在看还得两者都保留。。。所以 @areyouok 可以考虑支持删除name下所有子条目的功能。另外需要注意一点 springcache会自动在name 和key之间拼接:: 所以生成的rediskey略有不同 这个需要自己处理下 我目前简单粗暴的做了字符串拼接

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

Successfully merging this pull request may close these issues.

6 participants