Bird
0
0

Which annotation is used to enable caching support in a Spring Boot application?

easy📝 Syntax Q12 of 15
Spring Boot - Caching
Which annotation is used to enable caching support in a Spring Boot application?
A@EnableCaching
B@Cacheable
C@CacheConfig
D@CachePut
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot caching setup

    To activate caching, Spring Boot requires a special annotation on a configuration class.
  2. Step 2: Identify the correct annotation

    @EnableCaching enables the caching mechanism globally in the app.
  3. Final Answer:

    @EnableCaching -> Option A
  4. Quick Check:

    @EnableCaching activates caching [OK]
Quick Trick: Enable caching with @EnableCaching annotation [OK]
Common Mistakes:
  • Using @Cacheable to enable caching (it marks methods, not enable)
  • Confusing @CachePut with enabling caching
  • Thinking @CacheConfig enables caching globally

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes