Get CV

Frontend

Vue SSR now ships one locale

The document is English, Russian, or German. Not all three. Language change is a new URL, not a second dictionary in the heap.

This site is Vue SSR, not an SPA. The first HTML has to be the page the crawler and the visitor both see. It also has to match the locale in the URL. The old entry imported en, ru, and de on every render, then picked one. Node kept the other two in the isolate. The serialized state repeated the same three dictionaries so the client could switch language without a navigation.

Nobody switched language without a navigation. The extra JSON sat in the document and in the heap. The vue container sat near 700 MB after a quiet morning.

One request locale. One message table. The other two files stay on disk.
One request locale. One message table. The other two files stay on disk.

What the entry loads now

The SSR server loads messages for the request locale only. The client hydrates that table. A language change hits a new URL and a new document. That is already how the router works with en, ru, and de.

Formatted dates go into the serialized state. The client does not recompute them on mount. That removed a hydration warning and a locale mismatch at the same time. Static regions that never listen to i18n stay server-only.

The client hydrates the same strings the server printed. A language change is a navigation.
The client hydrates the same strings the server printed. A language change is a navigation.

What to watch

A missing message key now fails in one locale, not three. Seeds still carry all three languages, so a form that saves only the active locale is still a bug. The vue process recycles after a memory ceiling, the same idea as pm.max_requests on PHP-FPM.

Heap on a warm worker settled near 180 MB. First HTML lost the unused dictionaries. The page still looks the same. It just stopped shipping two languages nobody asked for.

Back to news