0

I have an AWS API Gateway endpoint(Invoke URL),
I created a Custom Domain, to map the Domain with my API Gateway as the Invoke URL is made of non user friendly characters,
I mapped the Custom Domain with the API Gateway,
I followed these steps -
http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html
Both the Default Invoke URL and Custom Domain endpoint are responding correct data,
So far so good.

On further testing I found out that as my default Invoke URL had Caching enabled on it,
I enabled API Gateway cache by following this -
http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
The response was in miliseconds,

Weirdly the Custom Domian mapped endpoint is responding slower and looks like it is not Caching the previous responses, even though Caching is properly enabled on the API Gateway,

I need to Enable Caching on the Custom Domian as well,
Do I need to add CloudFront in front of the API Gateway or something?
How do I achieve this?

I am not able to find my Invoke URL in CloudFront origin,
I couldn't understand these solutions either -
1. http://www.davekonopka.com/2016/api-gateway-domain.html
2. How do you add CloudFront in front of API Gateway

Community
  • 1
  • 1
Dev1ce
  • 5,390
  • 17
  • 90
  • 150
  • You should not need to configure anything additional to get caching working because you're using a custom domain. Can you provide evidence that caching isn't working only when you invoke your API through your custom domain? "endpoint is responding slower" is insufficient. – Lorenzo d Mar 04 '17 at 00:57
  • I came to conclusion based on the response time, though I understand that can't be the base. From what I understand "x-cache miss from cloudfront" of the Browser's developer tools cannot be used to conclude non Caching either, How do I find out that Cache is actually working? CloudWatch is one option as It has CacheHit and CacheMissCount metrics, Any way I can use as a proof that the Cache is actually working? – Dev1ce Mar 04 '17 at 17:17

0 Answers0