diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index 43cd66f661..62d367bffe 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -185,6 +185,9 @@ async function main() { if ((missingAsset.headers.get("x-content-type-options") ?? "").toLowerCase() !== "nosniff") { throw new Error("Smoke test failed: expected nosniff on missing asset response."); } + if ((missingAsset.headers.get("cache-control") ?? "").toLowerCase() !== "no-store") { + throw new Error("Smoke test failed: expected cache-control=no-store on missing asset."); + } const postPage = await fetch(parsedAppUrl, { method: "POST", body: "noop", diff --git a/apps/t3/src/cli.ts b/apps/t3/src/cli.ts index 895dacf287..1baf2af348 100644 --- a/apps/t3/src/cli.ts +++ b/apps/t3/src/cli.ts @@ -571,6 +571,7 @@ function startStaticWebServer(distRoot: string, port: number) { response.setHeader("Content-Type", "text/plain; charset=utf-8"); response.setHeader("Content-Length", String(body.byteLength)); response.setHeader("X-Content-Type-Options", "nosniff"); + response.setHeader("Cache-Control", "no-store"); for (const [key, value] of Object.entries(extraHeaders)) { response.setHeader(key, value); }