Skip to content

Commit bf72273

Browse files
authored
Merge pull request #468 from PretendoNetwork/feat/caching-topics
Add cache control headers for slow endpoint
2 parents 9a3edfc + 53aea7e commit bf72273

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

apps/miiverse-api/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ app.use((error: unknown, request: express.Request, response: express.Response, n
7070
return next(error);
7171
}
7272

73-
request.log.error(request, 'Request failed!');
73+
request.log.error(error, 'Request failed!');
7474
return serverError(response, ApiErrorCode.UNKNOWN_ERROR);
7575
});
7676

apps/miiverse-api/src/services/api/routes/topics.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ router.get('/', async function (request: express.Request, response: express.Resp
6767
allowEmpty: true
6868
});
6969

70+
response.set('Cache-Control', 'public, max-age=3600'); // * 1 hour
7071
response.send(xml);
7172
});
7273

0 commit comments

Comments
 (0)