summaryrefslogtreecommitdiff
path: root/src/server/activitypub.ts
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2018-09-19 07:17:19 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-09-19 07:17:19 +0900
commit8414db57f00609377336896de20ffdf565d6c924 (patch)
tree40f5daef14ccc665bb469e75cd4291d05e9218c2 /src/server/activitypub.ts
parentAdd new shortcut (diff)
downloadmisskey-8414db57f00609377336896de20ffdf565d6c924.tar.gz
misskey-8414db57f00609377336896de20ffdf565d6c924.tar.bz2
misskey-8414db57f00609377336896de20ffdf565d6c924.zip
Specify AP Cache-Control (#2735)
Diffstat (limited to 'src/server/activitypub.ts')
-rw-r--r--src/server/activitypub.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts
index 2cbce8cfbc..adbc6639fa 100644
--- a/src/server/activitypub.ts
+++ b/src/server/activitypub.ts
@@ -75,6 +75,7 @@ router.get('/notes/:note', async (ctx, next) => {
}
ctx.body = pack(await renderNote(note, false));
+ ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});
@@ -91,6 +92,7 @@ router.get('/notes/:note/activity', async ctx => {
}
ctx.body = pack(await packActivity(note));
+ ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
});
@@ -122,6 +124,7 @@ router.get('/users/:user/publickey', async ctx => {
if (isLocalUser(user)) {
ctx.body = pack(renderKey(user));
+ ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
} else {
ctx.status = 400;
@@ -136,6 +139,7 @@ async function userInfo(ctx: Router.IRouterContext, user: IUser) {
}
ctx.body = pack(await renderPerson(user as ILocalUser));
+ ctx.set('Cache-Control', 'public, max-age=180');
setResponseType(ctx);
}