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(); });