In a Spring Boot application, which annotation is primarily used to mark a method as cacheable?

  • @CacheConfig
  • @CacheEvict
  • @CachePut
  • @Cacheable
In a Spring Boot application, the @Cacheable annotation is primarily used to mark a method as cacheable. When this annotation is applied to a method, the results of that method are cached, and subsequent calls with the same parameters will retrieve the cached result instead of executing the method again. The other annotations may be used for cache-related operations, but @Cacheable is specifically for marking cacheable methods.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *