diff --git a/packages/glitch-server/main.ts b/packages/glitch-server/main.ts index 276b166f..fa59350c 100644 --- a/packages/glitch-server/main.ts +++ b/packages/glitch-server/main.ts @@ -94,6 +94,7 @@ const handleManifestRequest = async () => { headers: { "Content-Type": "application/json; charset=utf-8", "Content-Length": String(JSON.stringify(manifest).length), + "Cache-Control": "max-age=31536000", Date: new Date().toUTCString(), }, }); @@ -171,6 +172,7 @@ const returnFile = async (file: BunFile, content?: string) => { headers: { "Content-Type": `${file.type}; charset=utf-8`, "Content-Length": String(file.size), + "Cache-Control": "max-age=31536000", Date: new Date().toUTCString(), }, }); diff --git a/server.ts b/server.ts index 4b59c96f..af0938ca 100644 --- a/server.ts +++ b/server.ts @@ -174,6 +174,8 @@ export const createServer = ( return null; }); + proxy?.headers.set("Cache-Control", "max-age=31536000"); + if (!proxy || proxy.status === 404) { if (config.frontend.glitch.enabled) { return (