Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

caching - Customize Spring-Boot Redis Cache

I need to add some logic before a value saved or retrieved from my redis cache. Let's say to encrypt and decrypt it, or manipulate the value itself, such thing. Is there any way I can do this?

Thank you


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can do whatever you want with the data pre/post serialization/deserialization.

You need to implement RedisSerializer<Object> interface for this.

See this answer for details https://stackoverflow.com/a/65623073/4255107


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...