mirror of
https://github.com/mempool/mempool.git
synced 2025-02-23 14:40:38 +01:00
Cache /block API response for 10 min on user side
This commit is contained in:
parent
50b040524e
commit
75dcfdd851
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue