JSR-107 aims to standardize caching annotations. Listed here are some of the important JSR-107 annotations:
- @CacheResult: Similar to @Cacheable.
- @CacheRemove: Similar to @CacheEvict, @CacheRemove supports conditional eviction if an exception occurs.
- @CacheRemoveAll: Similar to @CacheEvict(allEntries=true), it is used to remove all the entries from the cache.
JSR-107 and Spring's caching annotations are fairly similar in terms of the features they offer. Either of them is a good choice. We lean slightly more toward JSR-107 because it's a standard. However, make sure you are not using both in the same project.