Springboot cache doesn't work

Using springboot version 1.5.9 using redis as cache.

 

Problem performance: Individual classes can be used normally using cache annotations (@CacheConfig, etc.). Some classes use it, but it doesn't work. The overall performance is that sometimes it works and sometimes it doesn't work. Do not report any errors.

 

Solution: It turned out that the configuration file (application.yml) forgot to configure spring.cache.type = redis 

 

This is a pit, a pit. big hole.

 

A note to prevent yourself or others from jumping into the pit in the future:

*** Remember to enable caching spring.cache.type=none
*** Cached objects must implement Serializable
*** All support Spring transactions except GuavaCacheManager, that is, Cache data will also be removed when rolling back

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326357142&siteId=291194637