Tag AWS

Caching AWS Session Object using Spring Cache

Implementing caching for AWS sessions is crucial to improve performance, achieved by minimizing configuration loading. After migrating to Spring Boot, I utilized Spring Cache abstraction while retaining the Google Guava Expiring HashMap. The cache can be enabled with the `@EnableCaching` annotation and configured using Spring's annotations. The setup includes a custom `CacheConfiguration` class and caching behavior annotations on service methods, such as IamClient. Future migration to Redis is considered, and code examples are available on my GitHub repository.