From 6f76a04abe3e572ae56b873b7d2cd6f9e419c15a Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 10 Mar 2024 00:39:53 +0800 Subject: [PATCH] perf: remove http cache to fit github environment(maybe) --- src/server/router/telemetry.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/server/router/telemetry.ts b/src/server/router/telemetry.ts index 10db74b..7b026ca 100644 --- a/src/server/router/telemetry.ts +++ b/src/server/router/telemetry.ts @@ -56,7 +56,14 @@ telemetryRouter.get( async (req, res) => { recordTelemetryEvent(req); - res.header('Content-Type', 'image/gif').status(200).send(blankGifBuffer); + res + .header('Content-Type', 'image/gif') + .header( + 'Cache-Control', + 'no-cache,max-age=0,no-store,s-maxage=0,proxy-revalidate' + ) + .status(200) + .send(blankGifBuffer); } ); @@ -81,6 +88,13 @@ telemetryRouter.get( color: 'green', }); - res.header('Content-Type', 'image/svg+xml').status(200).send(svg); + res + .header('Content-Type', 'image/svg+xml') + .header( + 'Cache-Control', + 'no-cache,max-age=0,no-store,s-maxage=0,proxy-revalidate' + ) + .status(200) + .send(svg); } );