cloudfront 的默认缓存策略是什么(当 api 网关调用常规 lambda 运行 时)

What is the default cache policy of cloudfront (when regular lambda running calling by api gateway )

“cloudfront”的默认缓存策略是什么(当常规 lambda 运行 通过 api 网关调用时)

这取决于您对TTL 的配置以及是否配置了缓存。查看节流和缓存下的“亚马逊 API 网关是否提供 API 结果缓存”常见问题解答: https://aws.amazon.com/api-gateway/faqs/

You can add caching to API calls by provisioning an API Gateway cache and specifying its size in gigabytes. The cache is provisioned for a specific stage of your APIs. This improves performance and reduces the traffic sent to your back end. Cache settings allow you to control the way the cache key is built and the time-to-live (TTL) of the data stored for each method. API Gateway also exposes management APIs that help you invalidate the cache for each stage. Caching is available for REST APIs in API Gateway.

如果启用此功能,则根据 https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html

The default TTL value for API caching is 300 seconds.

如果您配置 Edge-optimized API endpoint then you can configure your own CloudFront distribution and manage that in the CloudFront settings. If you do that, CloudFront documentation 说明

By default, each file automatically expires after 24 hours

另见