koa-cache-control
html cache control for koajs
Install
yarn add @redpill-paris/koa-cache-control
Configuration
Koa
const controlCache = require('@redpill-paris/koa-cache-control');
app.use(cacheControl([
'no-cache'
]));
See html control cache parameters
Specific options
async getUser(ctx) {
...
ctx.cacheControl = ['public', 'max-age=600'];
...
ctx.response.status = 200;
}