Open samchungy opened 3 weeks ago
Thx for creating the PR. I thought that caching was not needed anymore with v3. I will check your PR next week.
Have you seen that the canges made are breaking the tests?
Have you seen that the canges made are breaking the tests?
Interesting, I'll take a peek when I get some time 👀
Creating Http Clients per request is slow, as the client always has to re-establish a new connection with AWS. Not to mention, they're actually cause for concern when it comes to memory leaks, but fortunately with Lambdas they aren't long lived enough.
This PR changes the code to create single clients so we should see noticeable improvements with successive invocations of the Lambdas.
It's best practice to initialise these outside of the handler.