From 784c1c1c56a5da126d9721a635994c342aee28a9 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 19 May 2025 21:08:31 -0400 Subject: [PATCH] dont cache html --- src/back/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/back/index.ts b/src/back/index.ts index 00552cf..1e7ad90 100644 --- a/src/back/index.ts +++ b/src/back/index.ts @@ -44,10 +44,14 @@ const Responses = { return new Response(Bun.gzipSync(JSON.stringify(data)), respOptions); }, file: async (file: Bun.BunFile) => { + const isHTML = file.type === "text/html"; + return new Response(Bun.gzipSync(await file.arrayBuffer()), { headers: { "Content-Type": file.type, - "Cache-Control": "public, max-age=31536000", + ...(isHTML + ? { "Cache-Control": "no-cache" } + : { "Cache-Control": "public, max-age=31536000" }), "Content-Encoding": "gzip", }, });