Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jon0824's avatar

Optimizing Inertia.js Localization: DB-based translations vs. Static File Generation

Hi,

I am working on a project with dynamic language support where translation strings are stored in the database. Currently, these translations are passed via Inertia props on every request, which causes significant bloat in the data-page object (payload).

I want to eliminate this overhead. My proposed solution is to export the database translations into a static file (e.g., JSON) and regenerate this file whenever a translation is updated in the database.

How would you evaluate this approach in terms of performance and best practices? Is this a recommended pattern for avoiding payload bloat in Inertia?

1 like
1 reply

Please or to participate in this conversation.