Recall & Review
beginner
What is the purpose of the
@EnableCaching annotation in Spring Boot?It activates Spring's annotation-driven cache management capability, allowing the use of caching annotations like
@Cacheable in the application.Click to reveal answer
beginner
Where should you place the
@EnableCaching annotation in a Spring Boot project?You place it on a configuration class, often the main application class annotated with <code>@SpringBootApplication</code>, to enable caching across the app.Click to reveal answer
beginner
Which Spring annotation works together with
@EnableCaching to cache method results?The
@Cacheable annotation marks methods whose results should be cached when @EnableCaching is active.Click to reveal answer
intermediate
True or False:
@EnableCaching automatically configures the cache storage for you.False.
@EnableCaching enables caching support but you must configure the cache manager or use defaults like ConcurrentMapCacheManager.Click to reveal answer
intermediate
What happens if you forget to add
@EnableCaching but use @Cacheable annotations?The caching annotations will be ignored and no caching will occur because caching support is not activated without
@EnableCaching.Click to reveal answer
What does the
@EnableCaching annotation do in a Spring Boot app?✗ Incorrect
@EnableCaching turns on Spring's caching support so you can use caching annotations. It does not configure storage or cache all queries automatically.
Where is
@EnableCaching typically placed?✗ Incorrect
It is placed on a configuration class to enable caching globally, not on individual methods or entities.
Which annotation requires
@EnableCaching to work properly?✗ Incorrect
@Cacheable needs caching enabled by @EnableCaching to cache method results.
If
@EnableCaching is missing, what happens to @Cacheable methods?✗ Incorrect
Without @EnableCaching, caching annotations are ignored and methods run without caching.
Does
@EnableCaching configure the cache storage automatically?✗ Incorrect
@EnableCaching enables caching but you need to configure a cache manager or rely on Spring Boot defaults like in-memory cache.
Explain how
@EnableCaching works in a Spring Boot application and why it is important.Think about what happens when you want to cache method results.
You got /4 concepts.
Describe what happens if you use
@Cacheable without @EnableCaching in your Spring Boot app.Consider the role of <code>@EnableCaching</code> in activating caching.
You got /4 concepts.