Translated pages at the edge (Cloudflare)
On this page
Some sites cannot be translated at build time. Think of a server-rendered shop or a WordPress site. Edge delivery fixes that for search. A small program runs on your content delivery network, in front of your site. When someone asks for /fr/pricing, it fetches your normal /pricing page, puts the translation in, and returns real translated HTML from your own hostname. Search engines see translated text without running any script.
This is built and tested offline, including in the real Cloudflare runtime. It is not deployed anywhere. No account was used. Whether to offer it, and on which platforms, is OPEN. The steps below are for you or the owner to run. This repository never deploys.
Which path to use#
| You have | Use |
|---|---|
| A site you build yourself (static or a framework) | A build-time kit. No runtime and no cost |
| A site where you control the CDN and want translated addresses for search | Edge delivery |
| No server control (Wix, Squarespace, Webflow) | The script tag, with its limits |
How a request is handled#
- If the first part of the address is not one of your languages, your site answers as usual. Source pages cost nothing.
- Otherwise the program fetches the original page from your site.
- It checks your signed files, then translates the page.
- It sets the language and direction, a canonical link to itself, and hreflang links for every language plus a default.
- If anything goes wrong, it returns your original page, in the source language, with status 200, marked and not cached.
The language comes from the address only. It never looks at the browser's language or at cookies, and it never redirects by language.
What it never touches#
Forms and other non-page requests, your admin and API areas, checkout, cart and account pages, framework folders, robots.txt, sitemaps, and files such as images. These go to your site untouched, with the visitor's own cookies and headers.
Cloudflare steps#
You need a Cloudflare account with your site, a published and signed bundle (site key, public key and delivery addresses from the dashboard), and the Workers Paid plan. The free plan allows only 10 ms of processor time per request, which is too little to translate an uncached page: verify.
- Build the worker from the repository.
- Copy the template configuration and fill in the public values: site key, public keys, delivery addresses, source language, your site address and the route for your hostname.
- Check the configuration offline with the provided command.
- Optional: create a key-value store to share the verified copy of your files.
- Deploy with Cloudflare's tool. That step is your decision and your account.
- Test: a request for
/fr/should return a headerx-rl-edgethat starts withtranslated. - Add the sitemap hint and robots rules. See Translated addresses at the edge.
- To roll back, remove the route. Your source pages never depended on it.
Templates exist for Vercel, Netlify and Deno too. They are thin and have not been tried on the real platforms: verify.
Checking what it did#
Every response it touches carries x-rl-edge. Anything other than translated means your own page was served. The reason is in the header, such as no verified files, a missing language file, too little coverage, a page too large, or a page that is not a full HTML document.
Costs and limits#
The figures come from Cloudflare's documentation, read on 2026-10-29. Re-check them before relying on them: verify. Cached pages cost almost no processor time. The first request for each page, language and version costs the most. A real measurement on Cloudflare has not been done: verify. After you publish, translated pages update in about 5 to 10 minutes, or sooner if you clear the cache.
Keys#
All settings are public values. Never put a secret key (rl_sec_) in the worker.