From c1da2d5552b8b9f7e64d21bcc3984975b7210e36 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Thu, 15 May 2025 14:52:02 +0000 Subject: [PATCH] fix: add back cache-control headers but keep them super short, mostly to reduce traffic via external cache infra --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index cce7e1e..549e9f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,6 +61,10 @@ addon.use((_req: Request, res: Response, next: NextFunction) => { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Headers', '*'); + if (process.env['NODE_ENV'] === 'production') { + res.setHeader('Cache-Control', 'max-age=10, public'); + } + next(); });