I have an endpoint in API Gateway for path:
/v1/services
that returns all services in DynamoDB.
It is possible also to add query parameter like:
/v1/services?search={something}
and in this case services will be filtered depending on search string.
I added caches using stageOptions/methodOption like this:
methodOptions: {
'/v1/services/GET': {
cacheDataEncrypted: true,
cachingEnabled: true,
cacheTtl: Duration.minutes(3)
}
}
But in this case both /v1/services
and /v1/services?search={something}
requests will be cached for 3 minutes.
Is there a way to do add caches only for /v1/services
so only if no query parameters are present in request using AWS cdk?