What is the best way to implement local caching for AWS Lambda@Edge?
Here is the context: We have lambda@edge trigger in CloudFront that needs to retrieve a public key from public internet. This key rotates periodically. Making public call from lambda@edge to public internet introduces latency penalty, so we would ideally like to cache the data. We could, of course, use ElastiCache or DynamoDB as a cache layer, but that would negate the benefit of having lambda running at edge location as it would need to talk to resource in one of the regions.
One way I can think of is to store data in the static website S3 bucket with CloudFront distribution enabled. If I understand this correctly, this would mean that this file would also be present on CloudFront in the same edge location as lambda itself. Lambda could then make a call to static website and retrieve that file from edge cache. Is that a valid pattern? Is there a better solution?