Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- 'apps/docs/**'
- 'content/docs/**'
- 'content/blog/**'
- 'pnpm-lock.yaml'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/lib/layout.shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Image from 'next/image';

export const gitConfig = {
user: 'objectstack-ai',
repo: 'spec',
repo: 'objectos',
branch: 'main',
};

Expand Down
11 changes: 10 additions & 1 deletion apps/docs/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ export default function middleware(request: NextRequest) {
const url = new URL(request.url);
// Handle root path specially to avoid double slashes
url.pathname = pathname === '/' ? `/${i18n.defaultLanguage}` : `/${i18n.defaultLanguage}${pathname}`;
return NextResponse.rewrite(url);
const response = NextResponse.rewrite(url);
// This is a locale-negotiated response for a prefix-less path (e.g. "/").
// The underlying page is statically cached with a long s-maxage, but the
// *result here depends on the visitor's language* — so it must never be
// stored in a shared cache, or the CDN would serve this (default-locale)
// HTML to every visitor and non-English browsers would stop being
// redirected to their localized path. Mark it private so the edge skips it
// and middleware re-runs language detection on every request.
response.headers.set('Cache-Control', 'private, no-cache, must-revalidate');
return response;
}

// For non-default languages, redirect to the localized path
Expand Down
Loading