From ac693e55e0a7921262e974d8caa330acc02658e2 Mon Sep 17 00:00:00 2001 From: M1 Date: Tue, 17 Mar 2026 09:45:24 +0400 Subject: [PATCH] fix: immutable cache-control headers for versioned static assets --- apps/web/src/routes/dashboard.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/routes/dashboard.ts b/apps/web/src/routes/dashboard.ts index 4e1d465..1863630 100644 --- a/apps/web/src/routes/dashboard.ts +++ b/apps/web/src/routes/dashboard.ts @@ -82,10 +82,10 @@ async function getAccountId(cookie: any, headers: any): Promise { const dashDir = resolve(import.meta.dir, "../dashboard"); export const dashboard = new Elysia() - .get("/dashboard/app.js", () => Bun.file(`${dashDir}/app.js`)) - .get("/dashboard/app.css", () => Bun.file(`${dashDir}/app.css`)) - .get("/dashboard/tailwind.css", () => Bun.file(`${dashDir}/tailwind.css`)) - .get("/dashboard/query-builder.js", () => Bun.file(`${dashDir}/query-builder.js`)) + .get("/dashboard/app.js", () => new Response(Bun.file(`${dashDir}/app.js`), { headers: { "cache-control": "public, max-age=31536000, immutable" } })) + .get("/dashboard/app.css", () => new Response(Bun.file(`${dashDir}/app.css`), { headers: { "cache-control": "public, max-age=31536000, immutable" } })) + .get("/dashboard/tailwind.css", () => new Response(Bun.file(`${dashDir}/tailwind.css`), { headers: { "cache-control": "public, max-age=31536000, immutable" } })) + .get("/dashboard/query-builder.js", () => new Response(Bun.file(`${dashDir}/query-builder.js`), { headers: { "cache-control": "public, max-age=31536000, immutable" } })) // Login page .get("/dashboard", async ({ cookie }) => {