Introduction When CDN geographic routing sends users to the wrong region, they experience high latency and slow page loads. This defeats the purpose of having a global CDN.
Symptoms - Users in Europe served from US edge locations - High latency for users far from the serving edge - CDN logs showing unexpected edge location usage - Users reporting slow performance in specific regions - Latency-based routing not working as expected
Common Causes - DNS resolver location not matching user location - Geo-IP database outdated - Edge location not available in user's region - Latency-based routing not enabled - CDN not deployed in user's geographic region
Step-by-Step Fix 1. **Check which edge location is serving the user': ```bash curl -s https://cdn.example.com/cdn-cgi/trace | grep loc # Or check response headers for edge location curl -sI https://cdn.example.com/ | grep -i "x-amz-cf-pop|cf-ray|x-cache" ```
- 1.**Enable latency-based routing':
- 2.```bash
- 3.# Route 53 latency-based routing
- 4.aws route53 change-resource-record-sets \
- 5.--hosted-zone-id <zone-id> \
- 6.--change-batch file://latency-routing.json
- 7.
`