From 75dcfdd8518f04906be615c59ac8ac5c3c2b1c53 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 19 May 2022 12:17:26 +0200 Subject: [PATCH] Cache /block API response for 10 min on user side --- backend/src/routes.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/routes.ts b/backend/src/routes.ts index d7fe35b08..6c8c0176d 100644 --- a/backend/src/routes.ts +++ b/backend/src/routes.ts @@ -703,6 +703,7 @@ class Routes { public async getBlock(req: Request, res: Response) { try { const block = await blocks.$getBlock(req.params.hash); + res.setHeader('Expires', new Date(Date.now() + 1000 * 600).toUTCString()); res.json(block); } catch (e) { res.status(500).send(e instanceof Error ? e.message : e);