diff --git a/apps/ui-server-auth/README.md b/apps/ui-server-auth/README.md index b65769126..9411a43f9 100644 --- a/apps/ui-server-auth/README.md +++ b/apps/ui-server-auth/README.md @@ -23,7 +23,7 @@ pnpm -F @proj-airi/ui-server-auth build ## Deployment -`pnpm -F @proj-airi/ui-server-auth build` writes to `apps/ui-server-auth/dist`. Vue Router owns `/ui/*`, while Vite assets are served from root `/assets/*` so Cloudflare Pages can serve static files without rewriting nested asset paths. `public/_redirects` scopes the SPA rewrite to `/ui/*`, and the top-level `public/404.html` keeps missing assets and other unknown paths as HTTP 404 responses. +`pnpm -F @proj-airi/ui-server-auth build` writes to `apps/ui-server-auth/dist`. Vue Router owns `/ui/*`, while Vite assets are served from root `/assets-v2/*` so Cloudflare Pages can serve static files without rewriting nested asset paths. The versioned namespace moves existing clients away from previously poisoned `/assets/*` browser cache entries. Both namespaces use `Cache-Control: public, no-cache`, allowing browsers to retain files only when Pages revalidates them. `public/_redirects` scopes the SPA rewrite to `/ui/*`, and the top-level `public/404.html` keeps missing assets and other unknown paths as HTTP 404 responses. The production GitHub Actions workflow deploys this app to the Cloudflare Pages project `moeru-ai-airi-auth` with separate auth-account credentials: diff --git a/apps/ui-server-auth/public/_headers b/apps/ui-server-auth/public/_headers index 7f40d0894..5d3ccc5dd 100644 --- a/apps/ui-server-auth/public/_headers +++ b/apps/ui-server-auth/public/_headers @@ -1,4 +1,5 @@ /assets/* - cache-control: max-age=31536000 - cache-control: immutable + cache-control: public, no-cache +/assets-v2/* + cache-control: public, no-cache diff --git a/apps/ui-server-auth/src/cloudflare-pages-routing.test.ts b/apps/ui-server-auth/src/cloudflare-pages-routing.test.ts index d72b3801f..85d967346 100644 --- a/apps/ui-server-auth/src/cloudflare-pages-routing.test.ts +++ b/apps/ui-server-auth/src/cloudflare-pages-routing.test.ts @@ -23,4 +23,12 @@ describe('cloudflare Pages routing', () => { expect(notFoundPage).toContain('