Which annotation is used in Spring Boot to update the cache whenever the underlying data changes?
- @CacheUpdate
- @CacheEvict
- @CacheInvalidate
- @CacheRefresh
In Spring Boot, the @CacheRefresh annotation is used to update the cache whenever the underlying data changes. It's used to refresh the cache entries for a specific method or cache name. The other options are related to cache eviction, clearing, or invalidation but not specifically refreshing the cache upon data changes.
Loading...
Related Quiz
- Which annotation is used to test only the web layer in a Spring Boot application?
- To externalize configuration properties in Spring Boot, the _____ annotation can be used on a configuration properties class.
- How can you configure multiple DataSources in a Spring Boot application?
- Which Spring Boot feature is commonly used to automate the database schema creation and update process?
- You are developing a Spring Boot application, and you need to perform integration tests on a service layer with external API calls. How would you ensure that the external API is not called during the test, and the service layer’s behavior is tested accurately?