Skip to content

i18n/seo: keep locale out of paths while defining cache and indexing behavior #551

Description

@tiankaima

Product decision

Keep locale out of semantic paths and query strings. Existing unprefixed URLs remain canonical. Language is selected from the saved preference/cookie and normalized Accept-Language for anonymous requests.

This has an unavoidable SEO trade-off: the same URL cannot provide two independently crawlable canonical language pages or truthful reciprocal hreflang alternates. For now, Chinese is the default canonical/indexable representation; English is a complete adaptive user experience, not a separately guaranteed search index.

If independently indexed English becomes a requirement later, evaluate locale-specific hosts (for example en.example) as a separate product/operations decision. Do not add /zh-cn, /en-us, or locale query parameters.

Cache policy

  • Authenticated/personalized HTML remains private/no-store.
  • Anonymous caching, when [perf] Introduce an authenticated gateway for anonymous SSR edge caching #507 is implemented, normalizes locale before the cached entrypoint and includes the normalized locale in the internal representation key.
  • Never key shared HTML on raw Cookie or raw Accept-Language.
  • Emit correct html lang, Content-Language, localized title/description/social metadata, and a single self-canonical URL.
  • Use Vary consistently on negotiable APIs; do not emit misleading hreflang links to identical URLs.

Acceptance criteria

  • No locale path/query route is introduced.
  • Cookie, header, and explicit user preference produce aligned SSR HTML, metadata, and hydration.
  • Anonymous cache tests prove zh/en isolation and authenticated bypass.
  • The sitemap contains each semantic URL once; canonical URLs are stable.
  • Search documentation clearly states Chinese-indexing and English-adaptive limitations.
  • The language selector remains accessible and persists preference without creating duplicate canonical pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: frontendRendered pages, client interactions, responsive layout, accessibility, and i18narea: infrastructureProduction runtime, Cloudflare, storage, containers, deployment, and releasesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions