From b6fd5d728237ed32c251978359197d133efe8cae Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 27 Nov 2018 01:16:25 +0900 Subject: [PATCH] No caching /api/ (#3411) --- src/server/api/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/api/index.ts b/src/server/api/index.ts index 87da490acb..ebb3d5a27f 100644 --- a/src/server/api/index.ts +++ b/src/server/api/index.ts @@ -19,6 +19,12 @@ app.use(cors({ origin: '*' })); +// No caching +app.use(async (ctx, next) => { + ctx.set('Cache-Control', 'private, max-age=0, must-revalidate'); + await next(); +}); + app.use(bodyParser({ // リクエストが multipart/form-data でない限りはJSONだと見なす detectJSON: ctx => !ctx.is('multipart/form-data')