serverless-application-model
serverless-application-model copied to clipboard
how to enable api gateway cache ttl using methodSettings in yaml format?
How to enable api gateway cache ttl using methodSettings ? I am using this in template yaml but it does not work, it is not enabling caching at method level. Any thing missing here. Please help.
CacheClusterEnabled: true
CacheClusterSize: "1.6"
MethodSettings:
- ResourcePath: "/*"
CachingEnabled: true
CacheTtlInSeconds: 600
HttpMethod: "GET"
Please see the documentation regarding the encoding to "~1" https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-stage-methodsetting.html#cfn-apigateway-stage-methodsetting-resourcepath. Hopefully this will solve your problem.
It might be that you need to specify "/~1*" or "~1*".