← Quiz: Spring Boot Caching: all 10 questions
Quiz: Spring Boot Caching · Question 5 of 10
Why is @Cacheable ignored when findById is called from another method of the same class?
Why is @Cacheable ignored when findById is called from another method of the same class?
- A.Caching only works in controllers
- B.The cache name is wrong
- C.@Cacheable needs @Transactional too
- D.The call uses this, so it does not go through the caching proxy
Answer & explanation
Correct answer: The call uses this, so it does not go through the caching proxy
Spring caching is proxy-based, like @Transactional.
Can you get the rest right without peeking?
Take the timed Quiz: Spring Boot Caching quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →