In the above example, our application will use CaffeineCacheManager for the getCustomerDetail() method. And for the getCustomerOrders() method, it'll use alternateCacheManager.

3.2. Extending CachingConfigurerSupport

Another way we can do this is by extending the CachingConfigurerSupport class and by overriding the cacheManager() method. This method returns a bean which will be the default cache manager for our application:

Hi,
We always try to present a few different ways to achieve more or less the same goal. You should always pick the one that suits your needs best.
Using CacheResolver for example, you can select the appropriate CacheManager dynamically at runtime. This is not possible if you go with the first option.
Thanks for suggesting CompositeCacheManager. We’ll update the article.
Cheers