当我尝试从redis-cli显示密钥时,从我的应用程序方法生成的密钥生成 cachename~keys ,什么是〜密钥?我使用Spring Boot @Cacheable 注释和自定义键,它显示了这些。我试过谷歌搜索,但没有任何答案。它是键的通配符吗?我怎么能显示一切?感谢
答案 0 :(得分:0)
您需要在CacheManager bean中将参数“usePrefix”设置为true。这将在您的密钥中添加cacheName。
<bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager">
...
<property name="usePrefix"><value>true</value></property>
...
</bean>