CDN contract
This page is the source of truth for the delivery plane. Every other page links here instead of restating paths.
The URLs below are produced at documentation build time by calling
latestManifestUrl() and cdnUrl() from @localize-work/i18next-backend
itself, so they cannot drift from what the SDK actually fetches.
The two paths
Section titled “The two paths”1. The pointer
Section titled “1. The pointer”https://cdn.localize.work/your-project/latest.jsonOne small file whose entire body is the currently active release version:
{ "version": "v12" }It is overwritten on every publish and on every rollback. It is the only mutable object in the delivery plane.
2. The release file
Section titled “2. The release file”https://cdn.localize.work/your-project/v12/en/common.jsonImmutable. Once written, a file at a given version is never rewritten — not by a later publish, not by a rollback, not by editing or deleting the underlying key. Its body is plain i18next JSON; see published JSON format.
There is no latest/ directory
Section titled “There is no latest/ directory”Version format
Section titled “Version format”A version is the literal character v followed by a positive integer with no
leading zero: v1, v2, … v12. Versions are allocated per project as the
next integer above the highest existing one.
The SDK validates the pointer against /^v[1-9]\d*$/ and refuses anything else
with invalid latest release pointer — a pointer body that is not this shape is
treated as a configuration error, not a transient failure, so it is not retried.
The client read algorithm
Section titled “The client read algorithm”- Fetch
{cdnBaseUrl}/{projectSlug}/latest.json. - Read
versionfrom the JSON body. - Fetch
{cdnBaseUrl}/{projectSlug}/{version}/{locale}/{namespace}.jsonfor every locale and namespace you need. - Never mix versions within one initialisation. Resolve the pointer once and reuse the version for every file.
Step 4 is not a suggestion. If you resolve the pointer per file and a publish lands between two fetches, you get half of one release and half of another — which is exactly how you ship a page where the header is translated and the button is not. The SDK resolves the pointer once per backend instance and caches it for this reason.
Pin version: 'vN' explicitly and step 1 is skipped entirely.
Try it
Section titled “Try it”curl https://cdn.localize.work/your-project/latest.jsoncurl https://cdn.localize.work/your-project/v12/en/common.jsonCaching
Section titled “Caching”| Path | Cache-Control |
|---|---|
{slug}/latest.json |
public, max-age=300 |
{slug}/{version}/{locale}/{ns}.json |
public, max-age=31536000, immutable |
The files are served by localize.work’s own servers in the EU, which read
them from object storage and keep recent ones in memory. Publishing or rolling
back updates the server’s copy of latest.json within seconds, so the
300-second lifetime is how long a browser that already fetched the pointer may
keep using it — a ceiling, not the normal latency.
A 404 is not cached, so a project’s first publish is visible as soon as it finishes.
404 semantics
Section titled “404 semantics”| Request | 404 means |
|---|---|
latest.json |
Nothing has ever been published for this project, or the slug is wrong. |
{version}/{locale}/{ns}.json, base locale |
Real problem: that namespace has no published content in that locale. |
{version}/{locale}/{ns}.json, variant locale |
Normal. Variants publish sparse files; an absent file means “no overrides here”. |
That last row is the one that trips people up. The SDK resolves a 404 to an empty resource and lets i18next’s fallback chain supply the values — see variant locales.
https://cdn.localize.work/your-project/v12/en-FI/common.jsonConsuming it without the SDK
Section titled “Consuming it without the SDK”Nothing above requires our package. Two fetch calls in the right order is a
complete, supported integration:
const { version } = await fetch(`${cdnBaseUrl}/${slug}/latest.json`).then((r) => r.json());const common = await fetch( `${cdnBaseUrl}/${slug}/${version}/en/common.json`,).then((r) => r.json());Resolve the pointer once, at startup — not per key, and not per render.