Explicitly set max-age (#3330)

This commit is contained in:
MeiMei
2018-11-20 05:29:51 +09:00
committed by syuilo
parent ca0cb6fd42
commit e332e3c248
3 changed files with 10 additions and 0 deletions

View File

@ -189,6 +189,8 @@ router.get('/*/api/endpoints/*', async ctx => {
};
await ctx.render('../../../../src/docs/api/endpoints/view', Object.assign(await genVars(lang), vars));
ctx.set('Cache-Control', 'public, max-age=300');
});
router.get('/*/api/entities/*', async ctx => {
@ -204,6 +206,8 @@ router.get('/*/api/entities/*', async ctx => {
props: sortParams(Object.entries(x.props).map(([k, v]) => parsePropDefinition(k, v))),
propDefs: extractPropDefRef(x.props)
}));
ctx.set('Cache-Control', 'public, max-age=300');
});
router.get('/*/*', async ctx => {
@ -240,6 +244,8 @@ router.get('/*/*', async ctx => {
title: md.match(/^# (.+?)\r?\n/)[1],
src: `https://github.com/syuilo/misskey/tree/master/src/docs/${doc}.${lang}.md`
}, await genVars(lang)));
ctx.set('Cache-Control', 'public, max-age=300');
});
export default router;