How do I set up CDN delivery?
CDN delivery is how your app fetches translations at runtime. Instead of bundling translations in your build, your app loads them from Better i18n's global CDN — meaning you can update translations without rebuilding or redeploying.
How it works
Your app loads → SDK fetches translations from CDN → renders UI
↓
Multi-layer cache: memory → CDN → storage → fallback
Translations are served from edge locations worldwide with sub-100ms latency.
Enabling CDN
- Go to your project → Integrations tab
- Find the Content Delivery Network (CDN) card
- Click Manage
- Click Enable to activate CDN delivery
Once enabled, your translations are uploaded to the CDN every time you publish.
CDN URLs
Published translations are available at:
https://cdn.better-i18n.com/{org}/{project}/manifest.json
https://cdn.better-i18n.com/{org}/{project}/{locale}/translations.json
You don't need to use these URLs directly — the SDK handles fetching automatically.
SDK configuration
Configure your SDK with your project identifier:
import { createI18n } from '@better-i18n/next';
const i18n = createI18n({
project: 'acme/dashboard',
defaultLocale: 'en',
});
The SDK will:
- Check in-memory cache (60s TTL)
- Fetch from CDN if cache is stale
- Fall back to persistent storage (mobile/offline)
- Use static fallback data if everything else fails
Cache behavior
| Layer | TTL | Purpose |
|---|---|---|
| In-memory (SDK) | 60 seconds | Fastest access |
| CDN edge | Purged on publish | Global distribution |
| Persistent storage | Indefinite | Offline/mobile support |
| Static fallback | Build-time | Last resort |
After publishing, users see updated translations within ~60 seconds.
CDN without GitHub
CDN delivery works independently of GitHub. You can:
- Upload JSON files directly
- Edit translations in the dashboard
- Use AI to translate
- Publish to CDN
No repository connection required.
Next steps
¿Te resultó útil este artículo?