Spring @Cacheable not caching - Stack Overflow
Imagine you go to the Zoo. You go through the entrance once and pay your entry. Afterwards you can visit the Lions, the Tigers, and so on... You don't have to pay everytime because you did it when you entered. If you get bored and want to go to another Zoo, you have to go out, go to the next one, and pay again.
Your Class is the Zoo, your Methods are the Animals, and the Cache Proxy is the Entrance. When someone calls your class, it goes through the Cache once. When she is in, and calls another methods of the same class, it doesn't go through the Cache again. Only when you go out and in again, you go through the Cache.
Read full article from Spring @Cacheable not caching - Stack Overflow
No comments:
Post a Comment