Skill 4.3.6

Implement application-level caching to improve performance

Key Concepts

The simplest cache is in memory within the process. In Lambda, values stored outside the handler, such as configuration or secrets, persist across warm invocations. The Parameters and Secrets Lambda extension and the Secrets Manager caching clients cache values with a TTL.

Shared caches such as ElastiCache serve all instances, using lazy loading or write-through strategies with TTLs, while DAX caches DynamoDB reads. Caches must have an invalidation or expiry strategy, and the application should still work if the cache is empty or unavailable.