From 4f4783e9840e8547afd0c65db0a3da69cfbba0e8 Mon Sep 17 00:00:00 2001 From: Will Washburn Date: Thu, 15 Oct 2026 17:13:17 -0700 Subject: [PATCH] Send vanity redirects with Cache-Control: no-store The router's edge 302s for /will, /khaliq, /founder and the other vanity aliases carry Cache-Control: no-store, matching the Next.js /founder handler. A cached 302 would pin a visitor to one founder's calendar. Co-Authored-By: Claude Fable 5.1 --- router/index.ts | 6 +++++- router/test/vanity-redirects.test.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/router/index.ts b/router/index.ts index 7d97541a..a40066b5 100644 --- a/router/index.ts +++ b/router/index.ts @@ -712,7 +712,11 @@ const router = { url.searchParams.forEach((value, key) => { redirectUrl.searchParams.append(key, value); }); - return Response.redirect(redirectUrl.toString(), 302); + // Never cache: a cached 302 would pin a visitor to one /founder calendar. + return new Response(null, { + status: 302, + headers: { Location: redirectUrl.toString(), "Cache-Control": "no-store" }, + }); } const agentChatCloudPath = getAgentChatCloudPath( diff --git a/router/test/vanity-redirects.test.ts b/router/test/vanity-redirects.test.ts index 831eafd4..f405c829 100644 --- a/router/test/vanity-redirects.test.ts +++ b/router/test/vanity-redirects.test.ts @@ -35,6 +35,7 @@ describe("router vanity redirects", () => { expect(response.status).toBe(302); expect(response.headers.get("location")).toBe(`${destination}?utm_source=test`); + expect(response.headers.get("cache-control")).toBe("no-store"); expect(cloudWebWorker.fetch).not.toHaveBeenCalled(); });