No caching /api/ (#3411)

This commit is contained in:
MeiMei 2018-11-27 01:16:25 +09:00 committed by syuilo
parent 33243e7176
commit b6fd5d7282

View File

@ -19,6 +19,12 @@ app.use(cors({
origin: '*' origin: '*'
})); }));
// No caching
app.use(async (ctx, next) => {
ctx.set('Cache-Control', 'private, max-age=0, must-revalidate');
await next();
});
app.use(bodyParser({ app.use(bodyParser({
// リクエストが multipart/form-data でない限りはJSONだと見なす // リクエストが multipart/form-data でない限りはJSONだと見なす
detectJSON: ctx => !ctx.is('multipart/form-data') detectJSON: ctx => !ctx.is('multipart/form-data')