Cloudfront adding extra latency for API Gateway

0

When calling the regional API Gateway Endpoints, response time is ~300ms, (same with custom domain name).

~300ms for https://xxxxxx.execute-api.us-west-2.amazonaws.com/stage/api/users ~300ms with custom domain name https://api.myexample.com/api/users Our webapp gets served from Cloudfront + S3 at https://myexample.com

Now to avoid CORS, I added another origin (API Gateway) in Cloudfront with behavior of /api/* to point to API Gateway

~800ms for https://myexample.com/api/users -> https://xxxxxx.execute-api.us-west-2.amazonaws.com/stage/api/users Basically Cloudfront is adding those extra 500ms, is there a way to optimize this?

I found similar question, but that was unanswered: https://stackoverflow.com/questions/52999581/api-gateway-edge-optimized-added-latency

1개 답변
0

Hi - Can you please try some steps for troubleshooting as guided on this https://repost.aws/knowledge-center/cloudfront-troubleshoot-latency Thanks

profile pictureAWS
전문가
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인