fix: immutable cache-control headers for versioned static assets
This commit is contained in:
parent
41bfe52f10
commit
ac693e55e0
|
|
@ -82,10 +82,10 @@ async function getAccountId(cookie: any, headers: any): Promise<string | null> {
|
||||||
const dashDir = resolve(import.meta.dir, "../dashboard");
|
const dashDir = resolve(import.meta.dir, "../dashboard");
|
||||||
|
|
||||||
export const dashboard = new Elysia()
|
export const dashboard = new Elysia()
|
||||||
.get("/dashboard/app.js", () => Bun.file(`${dashDir}/app.js`))
|
.get("/dashboard/app.js", () => new Response(Bun.file(`${dashDir}/app.js`), { headers: { "cache-control": "public, max-age=31536000, immutable" } }))
|
||||||
.get("/dashboard/app.css", () => Bun.file(`${dashDir}/app.css`))
|
.get("/dashboard/app.css", () => new Response(Bun.file(`${dashDir}/app.css`), { headers: { "cache-control": "public, max-age=31536000, immutable" } }))
|
||||||
.get("/dashboard/tailwind.css", () => Bun.file(`${dashDir}/tailwind.css`))
|
.get("/dashboard/tailwind.css", () => new Response(Bun.file(`${dashDir}/tailwind.css`), { headers: { "cache-control": "public, max-age=31536000, immutable" } }))
|
||||||
.get("/dashboard/query-builder.js", () => Bun.file(`${dashDir}/query-builder.js`))
|
.get("/dashboard/query-builder.js", () => new Response(Bun.file(`${dashDir}/query-builder.js`), { headers: { "cache-control": "public, max-age=31536000, immutable" } }))
|
||||||
|
|
||||||
// Login page
|
// Login page
|
||||||
.get("/dashboard", async ({ cookie }) => {
|
.get("/dashboard", async ({ cookie }) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue