Bird
0
0

Which annotation is used in Spring Boot to enable caching support when using Redis?

easy📝 Syntax Q12 of 15
Spring Boot - Caching
Which annotation is used in Spring Boot to enable caching support when using Redis?
A@RedisCache
B@Cacheable
C@EnableCaching
D@CacheConfig
Step-by-Step Solution
Solution:
  1. Step 1: Identify the annotation to activate caching

    @EnableCaching is used on a configuration class to turn on caching support.
  2. Step 2: Differentiate from other annotations

    @Cacheable marks methods to cache results, but does not enable caching globally.
  3. Final Answer:

    @EnableCaching -> Option C
  4. Quick Check:

    Enable caching = @EnableCaching [OK]
Quick Trick: Use @EnableCaching to activate caching in Spring Boot [OK]
Common Mistakes:
  • Confusing @Cacheable with enabling caching
  • Using non-existent @RedisCache annotation
  • Mistaking @CacheConfig for enabling caching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes