No caching /api/ (#3411)
This commit is contained in:
parent
33243e7176
commit
b6fd5d7282
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue