What is the default cache policy of "cloudfront" (when regular lambda running calling by api gateway )
What is the default cache policy of cloudfront (when regular lambda running calling by api gateway )
1 Answers
It depends on what you configure for the TTL and whether you configure caching. Check out the "Does Amazon API Gateway provide API result caching" FAQ under Throttling and Caching: 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.
If you enable this, then per https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
The default TTL value for API caching is 300 seconds.
If you configure an 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 states that
By default, each file automatically expires after 24 hours
Also see API Gateway Caching vs CloudFront

- 8,374
- 5
- 37
- 60
-
tnx, the point is that I don't use "Enable API cache" and I want to know the default TTL and catch settings of Lamda that use API Gateway (by default ) – rambler Dec 21 '21 at 07:47