dont cache html
All checks were successful
Code quality checks / biome (push) Successful in 11s

This commit is contained in:
Seth 2025-05-19 21:08:31 -04:00
parent cebf8feb6a
commit 784c1c1c56

View file

@ -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",
},
});