Warm Containers—Caching/Keep-Alive/Reuse - Serverless Architectures with AWS Lambda

Warm Containers—Caching/Keep-Alive/Reuse

As mentioned earlier, you should write code that takes advantage of a warm function container. This means scoping your variables in a way that they and their contents can be reused on subsequent invocations where possible. This is especially impactful for things like bootstrapping configuration, keeping external dependency connections open, or one-time initialization of large objects that can persist from one invocation to the next.