🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Caching only works in controllers
  2. B.The cache name is wrong
  3. C.@Cacheable needs @Transactional too
  4. 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 →