1 Answer
- Newest
- Most votes
- Most comments
0
Hi,
I wonder whether you perhaps have a Lambda@Edge function associated with your CloudFront distribution behaviors. If so, it may affect your latency-based routing decisions (as these functions are running in Regional Edge Caches, and not in the edge location (as described in this CloudFront Function announcement: https://aws.amazon.com/blogs/aws/introducing-cloudfront-functions-run-your-code-at-the-edge-with-low-latency-at-any-scale).
Also, you could have a look at the response headers your received from CloudFront, tracing which Edge location actually received your request (you are looking for a response header called X-Amz-Cf-Pop). Perhaps it would help you troubleshooting your routing issue further.
answered 2 years ago
Relevant content
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
I do have a function running, but I thought I'd accounted for the above- I use a cloudfront function, not a lambda@edge function to rewrite the path of the request from
/wss
to/
(as api gateway ws endpoints must be on the root path, and the behaviour must have a non root path). Given it's a Cloudfront function, should it not be running in Africa at the edge as opposed to the regional cache location?The POP being hit when making a request from a machine in Africa is TLV50-C2, Tel-Aviv.
Having rejigged some configuration, I've removed the need for the cloudfront function completely, so now a request is cloudfront -> behaviour to origin -> custom domain (latency routed) -> regional api gateway. Unfortunately this hasn't changed anything. The pop which handles the cloudfront request is still tel aviv.