CDN delivery
CDN delivery lets you serve your translation files from a globally cached endpoint, so your app can fetch translations quickly and reliably in production.
What CDN delivery is
Section titled “What CDN delivery is”When enabled, Translatable publishes your project’s translation files to a CDN-backed URL. Your app (or edge/server) fetches the latest translations from that URL instead of bundling them at build time.
Typical use cases:
- Ship updated translations without redeploying
- Reduce latency for global users
- Keep translation fetching cache-friendly
How it works
Section titled “How it works”At a high level:
- You enable CDN delivery for a project.
- Translatable generates a CDN URL for that project and format.
- Your app requests translations from the CDN at runtime (or during server rendering).
- The CDN caches responses for fast repeat requests.
What gets delivered
Section titled “What gets delivered”CDN delivery publishes exported translation files for your project, typically per language. The exact structure depends on your export format and key structure.
Caching and updates
Section titled “Caching and updates”CDNs cache content for speed. To make sure users get updates quickly without losing performance, keep these principles in mind:
- Translations are cacheable and should be served with caching headers.
- Updates may take a short time to propagate globally depending on caching and invalidation strategy.
Recommended integration approach
Section titled “Recommended integration approach”Client-side apps (SPA)
Section titled “Client-side apps (SPA)”Fetch translations on app start (or when the user switches language), then keep them in memory.
Good when:
- You want to update translations without redeploys
- You don’t want to bundle all languages
Server-side rendering (SSR)
Section titled “Server-side rendering (SSR)”Fetch translations on the server, then render pages with the correct language.
Good when:
- SEO matters
- You want translations available at first paint
Edge middleware
Section titled “Edge middleware”Fetch translations at the edge and inject them into responses.
Good when:
- You want ultra-low latency globally
- You handle locale routing at the edge
Reliability considerations
Section titled “Reliability considerations”- Use timeouts and fallbacks in your app (e.g. fall back to bundled defaults if the CDN is unavailable).
- Avoid blocking critical UI indefinitely on translation fetch.
- Consider a simple in-memory cache on the server to reduce repeated requests.
Security notes
Section titled “Security notes”CDN-delivered translation files are public (like any static asset). Do not store secrets in translation values.
If you have content that must remain private, keep it out of translation files.
Troubleshooting
Section titled “Troubleshooting”My app doesn’t see updated translations
Section titled “My app doesn’t see updated translations”- Your CDN cache may still be serving an older version.
- Try clearing your browser cache or testing with a cache-busting query parameter.
- Ensure your integration respects cache headers and doesn’t persist stale values.
I get a 404
Section titled “I get a 404”- Confirm CDN delivery is enabled for the project.
- Confirm you are using the correct project and language code.
- Ensure the requested format/path exists (e.g. JSON vs CSV).
Related
Section titled “Related”- Projects & languages: how language codes affect delivered files
- Strings & keys: how key structure affects export structure
- Plans & limits: CDN delivery availability by plan