CDN routing to US instead of São Paulo causing latency issues.
Great question about Sanity's CDN routing! Based on the API CDN documentation, here's how it works:
Yes, Sanity does have a CDN location in São Paulo, Brazil, and the CDN will intelligently route your requests to the closest available location.
According to the docs, Sanity currently has CDN locations in:
South America:
- São Paulo, Brazil
North America:
- Oregon, United States
- Iowa, United States
- Northern Virginia, United States
Plus locations in Asia, Oceania, and Europe
When you call [projectid].apicdn.sanity.io from NYC and São Paulo, the requests should be routed to the geographically nearest CDN location:
- From NYC: Your request will likely hit one of the US datacenters (Northern Virginia, Iowa, or Oregon)
- From São Paulo: Your request should be routed to the São Paulo CDN location
Additionally, Sanity uses a short-lived global CDN (powered by Fastly) in front of their own CDN infrastructure. This global CDN has points of presence on all continents and helps with edge optimization and routing.
The routing is automatic based on geographic proximity and network conditions - you don't need to configure anything. The CDN uses intelligent routing to ensure low latency and fast load times for users worldwide.
One thing to note: The global CDN layer doesn't cache private datasets or queries using the POST method, but it still helps with routing and performance optimization.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.