From 301c754e95787f592e2e7056bfb7f45b2b726b41 Mon Sep 17 00:00:00 2001 From: mei23 Date: Fri, 19 Apr 2024 17:10:59 +0200 Subject: [PATCH] [backend] Add Cache-Control to Bull Dashboard --- packages/backend/src/server/web/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index f3c1ea788..ab81400ab 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -55,6 +55,10 @@ app.use(async (ctx, next) => { const url = decodeURI(ctx.path); if (url === bullBoardPath || url.startsWith(`${bullBoardPath}/`)) { + if (!url.startsWith(bullBoardPath + '/static/')) { + ctx.set('Cache-Control', 'private, max-age=0, must-revalidate'); + } + const token = ctx.cookies.get("token"); if (token == null) { ctx.status = 401;