Replies: 3 comments
-
|
I would verify whether the cache you are enabling belongs to the merged API execution path or only to the source API. With AppSync merged APIs, the client is executing through the merged API endpoint. Even if the source API resolver has caching configured, that does not necessarily mean the merged API field execution will reuse the source API's resolver cache in the way a direct source API call does. A few things I would check:
If the same field caches when called via source API but not via merged API, this may simply be an AppSync service limitation rather than a CDK modeling issue. The pragmatic workaround is to cache at the Lambda/application layer for expensive source fields, especially if the cache key is domain-specific. CDK can express the infrastructure, but it cannot make merged API execution inherit source resolver cache behavior if the service does not apply it there. |
Beta Was this translation helpful? Give feedback.
-
|
@yES truly interested @Eyliticrate Ekoveevoke |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've set up an appsync merged api with several source apis via aws-cdk (typescript), in a source api I have a lambda datasource with a resolver function, im trying to cache this resolver using
PER_RESOLVER_CACHING. Creating a CfnApiCache on the source API does not appear to work. Creating a CfnApiCache on the merged api seems to enable the cache, but doesnt allow me to configure it on the resolver level (I believe it caches the full request). I am looking for a configuration/solution which allows me to flexibly set the cache TTL on each fieldName of each source api. I've also searched rigorously through the AWS Documentation and not able to find something that helps alleviate this problem.The version of aws-cdk I am using is 2.1029.4
Any help is greatly appreciated thanks.
Note: The CfnApiCache +
PER_RESOLVER_CACHINGworks on a source api that is not associated with any merged api. But as soon as you associate the merged API it ceases to work and there are no cache metrics in cloudwatch.Beta Was this translation helpful? Give feedback.
All reactions