Skip to content

[hosting/i18n] Every module's full locale catalog ships in every page payload — including admin-only strings on anonymous public pages #248

Description

@antosubash

Found during a perf pass on globalcanopyatlas (simple_module_hosting 0.0.26, 10 modules installed).

Symptom

The Inertia shared props inline the complete merged i18n catalog on every request. On an anonymous public content page, the breakdown of the 9.4 KB i18n prop:

permissions: 2,612 B (admin UI strings)
settings: 2,041 B (admin form labels/placeholders)
branding: 1,294 B (admin)
file_storage: 1,272 B (admin)
dashboard: 663 B (admin)
auth: 118 B

~85% of it is strings an anonymous visitor can never see ("Delete setting …? This cannot be undone."), re-sent on every full page load and every Inertia visit, and it grows linearly with installed modules — a 30-module host would ship tens of KB of admin locale text per public page view.

Suggested direction

Options, roughly in order of leverage:

  1. Scope catalogs by audience: modules already declare admin vs public pages — only merge catalogs of modules whose strings can appear for the current user (or split admin.* keys out for authenticated staff only).
  2. Serve the catalog as a separate cacheable asset (per locale + catalog hash) instead of inlining it into every payload, so repeat visits pay nothing.
  3. At minimum, let a host exclude modules from the public-page catalog via settings.

(Not a correctness bug — flagging because it's structural payload growth every SimpleModule site inherits.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions